Scriptbaker Blog
Bringing you the latest technology trends, engineering guides, industry thinking, and practical tutorials from the Scriptbaker team.
The Scriptbaker blog is where our engineers and consultants share what they are building, learning, and thinking about across software development, artificial intelligence, cloud infrastructure, and modern web engineering. Whether you are a developer looking for practical code-level tutorials, a technical leader exploring AI strategy, or a business owner trying to understand how emerging technology applies to your industry, you will find relevant, actionable content here.
Our articles cover a broad range of topics — from deep dives into Magento extension development and WordPress performance optimisation, to guides on building AI agents, integrating large language models into production systems, and architecting scalable cloud-native applications. We also publish case studies from our client work, giving you a behind-the-scenes look at how we solve real problems for real businesses.
All content is written by practitioners — people who spend their days writing code, architecting systems, and shipping products — so you can trust that the techniques and recommendations are grounded in hands-on experience rather than theory. Browse by category below to find content relevant to your stack, or scroll down to explore our latest and featured articles.
Random string generator
Learn how to generate random strings in PHP with a simple, reusable function. This guide explains how the generator works, how to create strings of different lengths, common use cases, and secure alternatives using random_bytes() and random_int() for authentication tokens and other security-sensitive applications.
Set Magento store's base link URL programmatically
Learn how to set Magento’s base link URL programmatically using the setup installer. This guide explains base_link_url vs. base_url, store-specific configuration, secure and unsecure URLs, common errors, troubleshooting, and best practices for managing Magento URL settings.
Set Magento Template, Skin & Layout
[code language=”php”] $groups[‘theme’][‘fields’][‘template’][‘value’] = ‘template_name’;
Magento get store by storecode
Learn how to efficiently retrieve a Magento 1 store by its unique store code without unnecessary loops. This guide explains how to use Magento’s built-in Mage::app()->getStore() method, handle invalid store codes safely, and improve code performance and memory efficiency in multi-store environments.
Magento: Render static block in a phtml file
Learn how to render a Magento 1 static block directly inside a PHTML template using the cms/block block type. This guide covers how to create and load CMS static blocks, use block identifiers, render content with PHP, troubleshoot common display issues, and choose between PHTML, layout XML, and CMS directives.
MySQL calculate hours since row created
Learn how to calculate the number of hours that have passed since a MySQL row was created. This guide explains how to use TIMESTAMPDIFF() with created_at, compares it with DATEDIFF(), and covers practical examples for calculating hours, minutes, seconds, and records older than a specific time period.
Remove index.php from URL in YII
Learn how to configure Yii's UrlManager and Apache .htaccess rules to create clean, user-friendly URLs. This guide covers URL configuration, rewrite rules, common issues, and practical tips for improving Yii application routing
Style file upload field
Learn how to transform a standard HTML file upload field into a stylish and user-friendly upload control using jQuery File Style. This guide covers the required jQuery files, implementation steps, customization options, multiple file inputs, and important file upload considerations.
Yii Rights: Get all assigned roles of a user
Learn how to retrieve user roles in Yii Framework using the authassignment table, CDbCommand, and queryAll(). This guide explains how to fetch and store user roles, use parameter binding for safer SQL queries, leverage Yii’s built-in authorization manager, and implement role-based access control in PHP applications.
How to change Magento Base URL
Learn how to configure and change the Magento Base URL, secure and unsecure URLs, HTTPS settings, domain migrations, localhost installations, and common URL problems. This guide also covers cache clearing, database updates, and essential SEO checks after changing your Magento store URL.
How to reindex tables with MySQL
Learn how to remove AUTO_INCREMENT from the WordPress wp_posts ID column, manage primary keys, verify database changes, and safely modify your WordPress database structure.
jQuery Alert Dialogs by Bill Beckelman
Learn how jQuery Alert Dialogs by Bill Beckelman can replace basic JavaScript alerts with customizable dialog boxes. This guide covers implementation, form validation, message types, benefits, and key considerations for using jQuery alert dialogs in modern and legacy web applications.
JQuery Multi fileupload
Discover how jQuery File Upload simplifies file handling with multiple file selection, drag-and-drop support, upload progress bars, image previews, chunked uploads, and resumable transfers. This guide explores its key features, backend compatibility, common use cases, implementation considerations, and security best practices for modern web applications.
How to Add a jQuery Tooltip to Your Web Page
Learn how to add a jQuery tooltip to your web page using Tipsy. This guide explains how tooltips work, why they improve usability, how to implement and customize them, common use cases, and best practices for creating helpful and accessible web interfaces.
jQuery UI Multiselect by Michael
Learn how jQuery UI Multiselect improves traditional HTML multiple-select controls with a cleaner interface, flexible styling, and easier selection management for web forms.
keyup function with delay
This code will execute a function after the user has stopped typing for a time of 1000ms. Hence the function will not be called on each keyup event. Grea
Magento Admin: 404 Error Page not found.
Getting a 404 error in the Magento Admin after installing an extension? Learn why newly added configuration tabs may show “Page Not Found” and discover simple fixes, including refreshing your admin session, checking permissions, clearing cache, and troubleshooting extension configuration.
Disabled Yii logs and stack trace messages
Open up the index.php from root folder and comment out following 2 lines [code language=”php”] defined(‘YII_DEBUG’) or define(‘YII
Disable Browser's Back button
Learn why you can’t truly disable the browser Back button using JavaScript and how to properly manage app state using the History API, popstate, and bfcache instead.
Get Magento root category id
Learn how to retrieve the root category ID in Magento 1, understand the category hierarchy, avoid inefficient database queries, and use Magento’s built-in methods for cleaner, faster store development.
Get Magento Website Meta Data and Config Values
Following functions will help you to get Magento meta data like “Default Title”, “Default Description” To get Default Title: [code langu
AI Agents for Marketing Teams: A Practical Guide
A practical guide to AI agents for marketing teams: what they actually do, how they differ from marketing automation, and when it's time to build a custom one.
Add Home link in Magento top navigation menu
Learn how to easily add a Home link to the Magento top navigation menu using simple template changes and PHP code. By default there is no Home link in Magento top navigation menu but you can easily add it yourself.
AI Superintelligence: A 2026 Guide for Businesses
What "the road to superintelligence" actually means in 2026, where AI development really stands today, and how businesses can build on it safely and profitably.
AI Automation for Small Business: 10 Ways to Grow
AI automation is not about replacing your team or buying dozens of new tools. It is about identifying the repetitive work slowing your business down and building reliable systems to handle it.
Toggle checkboxes with jQuery and Prototype JS
Sometimes you work with forms having a long list of checkboxes, in such scenarios a “Check All” or “Toggle Selection” button comes handy
Magento 1: Export Catalog Categories by Store View
In this post you will learn how you can export Magento 1.9 categories for a specific store view as CSV. For example, you have Arabic store view with ID 7, and y
Magento 1: Export Manufacturers CSV by Store View
This post will guide you on how you can export the manufacturer list (Magento 1.9) to CSV file. In this script, I am filtering the list by store view. Let’
Search Magento products by product labels
Project Overview: Task was to develop a Product Labels Magento extension. Where admin can create product labels by uploading an image, enter label title and att
Adding Custom Fields to WordPress User Profile Page
Adding custom profile fields in WordPress made easy through action hooks. .Most of the solutions available on internet tell you about adding custom fields on &#
How to Conditionally remove Magento header/footer?
<p>Are you looking for a solution to conditionally remove Magento header footer but don’t know where to start? Right in this post I will show you how to create custom layout handles and utilize them to conditionally remove header/footer blocks.</p>
How to make Yii checkBoxList selected
Many people find it hard to make the Yii checkBoxList selected on update view, but believe me in fact its very easy and straight forward. This post will help yo
Yii Multiple Related Models Save Guide
Scenario: You are in a situation where you have two related tables a Parent and a child table. You need to create a user experience in which user presses Save b
Separate Front & Admin in Yii
In my previous post I demonstrated you how to render different layout for different user role, now lets move a step forward and see how to create separate front
Multi Image Upload
Multi Image Upload adds a meta box to upload multiple images for posts and pages. You can enable it for custom post types also. Download: http://wordpress.org/p
Script Logic Plugin
Introduction Script Logic is a WordPress plugin that lets you control on which pages scripts and style sheets load using WP’s conditional tags. This plug
Fetch Records from a SugarCRM Module via REST API
Its very common problem for many people to fetch data from SugarCRM application and feed it to some other application. Using REST API we can easily fetch list o
Magento Order Using Saved Credit Card
Creating order is the basic functionality of Magento but its the trickiest one at the same time for developers. Yes, its true because its not straight forward l
Get Selected Value from Yii RadioButtonList
Sometimes you want to get selected value of radioButtonList using jQuery in your Yii powered application and it feels difficult due to Yii’s field naming
Install WordPress Plugins Without FTP Access
You must have experienced that WordPress asks for FTP credentials if you initiate upgrade or install plugins. And sometimes developers don’t have FTP access and
Lamudi.pk Real Estate Growth
There are several online real estate portals running in Pakistan, a couple of them have captured the market and leading the industry. In such a scenario it’s ha
My 3 Days Trip to Swat, Malam Jabba and Kalam
Pakistan is a land of natural beauty and has been blessed with the abundance of awe-inspiring outdoor areas. From the unspoiled golden beaches,across the desola
Magento 2: Fix Can't Create Directory Error
You may encounter below fatal error While installing Magento 2.0 Fatal error: Uncaught exception ‘Magento\Framework\Exception\LocalizedException’ wi
How to install Laravel on Ubuntu
How to install Laravel on Ubuntu | Scriptbaker
Parse Salesforce & Migrate to SugarCRM
In previous post you learnt how to create REST API to fetch data from SugarCRM application, in this tutorial you will learn to migrate data from Salesforce to S
Add custom Javascript in Magento admin form
Learn how to add custom JavaScript to Magento admin forms using setAfterElementHtml. This step-by-step guide covers field-level scripting, practical use cases like conditional field visibility, and best practices for keeping your Magento admin customisations clean and upgrade-safe.
How to change logo of SugarCRM application
After completing installation of SugarCRM community edition, one of the first things you may want to change is the application logo. SugarCRM provides the optio
Common mistakes in WordPress Theme Development
This post will let you know about common mistakes in WordPress theme development and also tell you how to avoid them. Template Tags: WordPress template tags are
Create a WordPress Form and Handle Submissions
There are cool plugins available that create forms without any programming effort but still many times we need to create custom forms in our WordPress website.
Get custom attribute value in Magento
So you have created some custom attributes for your Magento products and now you want to fetch their values. Magento provides a function getAttributeText that t
Make SugarCRM Field Read-Only Dynamically
Let’s suppose you want to make Mobile field readonly based on Title field’s value in Contacts Module. SugarCRM Dependencies: You can achieve above with SugarCRM
Render Custom PHTML in a Magento Admin Tabs Block
It’s possible to add custom tabs on any page of Magento administration panel. Normally tabs are generated by Form Blocks, this is fine if you want to crea
Ajax based Yii login form
Ajax helps us creating fancy forms, Ajax based forms boost user experience. Yii framework provides ajax validation but at the end form is submitted without ajax
Yii 1.1: Behaviors & Events
Behaviors & Events provide endless possibilities and unbelievable flexibility, but as current Yii documentation does not give more than a few examples, it m
Switch Yii layout based on user role
You can assign different layouts to different users using following filter class 1. Add LayoutFilter.php to your protected/components/ folder [code language=
Add remove Wordpress dashboard widgets
WordPress comes with a bunch of widgets loaded on its dashboard. The default WordPress dashboard may seems cluttered to some users because many widgets may be i
mouseover with delay (using hoverIntent plugin)
hoverIntent is a plug-in that attempts to determine the user’s intent… like a crystal ball, only with mouse movement! It works like (and was derived
Trigger Google conversion on some event
Normally Google conversion code is added in header or footer of the “Thank you for your purchase” pages. A conversion is logged when someone lands o
Table 'DATEBASE_NAME.AuthAssignment' doesn't exist
<p>If you have used Rights module for RBAC in your Yii application and you deploy it on Linux based server, you may encounter this error.</p>
WordPress search filters based on custom fields
WordPress custom fields are good for adding meta data to posts. These custom fields are not just for displaying data but can be used to sort and filter posts. Y
Configure Authorize.net in Magento
Magento has various built-in payment methods, one of them is Authorize.net. To enable and configure Authorize.net as your payment processor, you should have API
Keeping your Yii Models Lean - Use Behaviors
Active Record models are fantastic for consolidating “black box” logic and keeping your models self-aware of their business logic, but what do you d
Magento Admin Grid: Add Radio/Checkbox Column
Magento grids are very useful for displaying/filtering and sorting data. Their flexibility is endless, you can customize them in any way. One may want to add a
Yii password, repeat password fields
Yii framework has awesome input validation mechanism, one of the many validation rules is “compare” rule. You can utilize it for creating confirmati
Post to your Facebook wall using Javascript SDK
Step1: [code language=”html”] <div id="fb_div"> <h3>Post to your Facebook wall:</h3> <br /> <textarea i
Allow admin to change user role
1. Add following code to _form.php [code language=”php”] Yii::app()->getModule(‘rights’); if (Yii::app()->user->isSuperuser) {
Add custom menu item for WP subscribers panel
Learn how to add a custom menu item to the WordPress admin panel that is visible only to subscribers. This tutorial covers add_menu_page, capability checks, rendering custom page content, and tips for keeping your admin UI clean and role-appropriate.
Change WordPress login screen logo
Learn how to replace the default WordPress login screen logo with your own branding. This guide covers the classic CSS-injection method, the modern enqueue approach, and how to update the logo link and title for a fully white-labelled login page.
Integrate Filemanager to FCKeditor in YII
Before starting the tutorial you may also like to view the fully functional demo, or you may download the example and start working on it. Please note that this
debug WP Queries and boost performance
Learn how to identify slow and unnecessary WordPress database queries, troubleshoot performance issues, and optimize your website for better speed, efficiency, and user experience.
