How to change from eregi (deprecated) to preg_match function in Zencart with PHP5.3

eregi_replace() is deprecated as of PHP 5.3.0. Use preg_replace() with the i (
===================================================================
admin/includes/classes/phplot.php

in function SetPlotType($which_pt):

$accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
//$asked = trim($which_pt);
$asked = ‘/’.trim($which_pt).’/i’;
if (preg_match($asked, $accepted)) {
$this->plot_type = $which_pt;
return true;
}
============================================
admin/includes/functions/compatibility.php

while(list($k, $line) = each($output)) {
//if(eregi("^$host", $line)) {
if( preg_match(‘/’.$host.’/i’, $line)) {
return true;
}
}
=============================================
admin/includes/functions/password_funcs.php

if ( preg_match(‘/^[a-z0-9]$/i’, $char)) $rand_value .= $char;

=========================================
admin/whos_online.php

if ( preg_match (‘/^(.*)’ . zen_session_name() . ‘=[a-f,0-9]+[&]*(.*)/i’, $whos_online- >fields[‘last_page_url’], $array))

=====================================
includes/classes/language.php

if ( preg_match(‘/^(‘ . $value[0] . ‘)(;q=[0-9]\\.[0-9])?$/i’, $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {

=====================================
includes/functions/functions_email.php

1) if (preg_match(‘/’."\r/i" ,$value) || preg_match(‘/’."\n/i",$value)) return false;
2) if (preg_match("/ *([^<]*) *<([^>]*)> */",$from_email_address,$regs)) {
3) if (preg_match("/ *([^<]*) *<([^>]*)> */",$value,$regs)) {
4) elseif (preg_match("/ *([^ ]*) */",$value,$regs)) {
5) if (!preg_match(‘/’.$space_check .’/’, $email)) {
if ( preg_match(‘/’.$valid_email_pattern.’/i’, $email)) {

=====================================
includes/modules/pages/contact_us/header_php.php

$send_to_email= preg_replace ("/>/i", "", $send_email_array[0]);
$send_to_email= preg_replace ("/</i", "", $send_to_email);
$send_to_name = preg_replace(‘/\<[^*]*/i’, ”, $send_to_array[$_POST[‘send_to’]]);

=====================================
includes/modules/attributes.php

1) if ((preg_replace(‘/txt_/’, ”, $key) == $products_options_names->fields[‘products_options_id’])) {
=====================================
includes/modules/pages/advanced_search_result/header_php.php

=====================================
includes/modules/pages/gv_send/header_php.php

if (preg_match(‘/[^0-9/.]/’, $gv_amount)) {

Why you shouldn’t modify codes via Plugin Editor

It is important to note that any changes that you make directly into your plugin’s core files will be overridden when you update the plugin. In theory, you should never be using the plugin editor to edit any files. Often developers use the built-in editor to view the code to make appropriate changes by utilizing a hook or filter within the plugin. If for some reason you find an absolute need to edit the plugin’s core file, then we recommend that you talk with the plugin author first. Perhaps there is a better way of accomplishing what you are trying to do rather than modifying the core plugin file. The only reason why we say this is because you don’t want to spend the time to make the modifications every time you update the plugin. At the same time, you don’t want to stop doing plugin updates because that could put you at a serious security risk should there be a vulnerability in the plugin.

Unlike the the Theme Editor, if you make a syntax error in your plugin editor, then it won’t lock you out of your WordPress admin. It will simply deactivate the plugin and explain the error to you.

Lastly, you should only use this section if you know what you are doing.

Source: WPbeginner Glossary

Common WordPress errors after upgrading WP core or activating a new plugin, theme

Plugins Don’t Always Play Nice

Note that not all plugins ‘play nice’ by working together with other plugins or themes. When plugins don’t work well with other plugins or themes you have a ‘plugin conflict’. WordPress plugins can often ‘throw errors’ or cause conflicts with other plugins or themes since they are made by many different 3rd parties.

The path to your plugin folder on the remote server will look something like this: root/wp-content/plugins/my-plugin-directory-name/

The common errors are:

1) Fatal error: Call to undefined function is_site_admin() in /home/public_html/wp-content/plugins/my-plugin-directory-name/

2) [26-Jun-2015 11:05:25] PHP Fatal error: require() [function.require]: Failed opening required ‘/home/BLOG/public_html/wp-includes/load.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/BLOG/public_html/wp-settings.php on line 19

3) Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1816813 bytes) in /home/public_html/wp-includes/wp-db.php on line 499

4) Can’t login Admin Dashboard: You do not have sufficient permissions to access this page.
This error caused by mismatch option name value”_user_roles”, ” _capabilities”, “_user_level”, “_dashboard_quick_press_last_post_id”, “_user-settings”, “_user-settings-time” of database table prefix and the value defined in the database tables.

CSS fixes for IE browser

This is the CSS3 that can be added to stylesheet to fix styling in IE browser of all versions.

/***** Attribute ******/

/* IE6 */
#once { _color: blue }

/* IE6, IE7 */
#doce { *color: blue; /* or #color: blue */ }

/* Everything but IE6 */
#diecisiete { color/**/: blue }

/* IE6, IE7, IE8, but also IE9 in some cases :( */
#diecinueve { color: blue\9; }

/* IE7, IE8 */
#veinte { color/*\**/: blue\9; }

/* IE6, IE7 -- acts as an !important */
#veintesiete { color: blue !ie; } /* string after ! can be anything */

/* IE8, IE9 */
#anotherone  {color: blue\0/;} /* must go at the END of all rules */

/* IE9, IE10 */
@media screen and (min-width:0\0) {
    #veintidos { color: red}
}

/***** Selector Hacks ******/

/* IE6 and below */
* html #uno  { color: red }

/* IE7 */
*:first-child+html #dos { color: red }

/* IE8 (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }

/* Everything but IE6-8 */
:root *> #quince { color: red  }

/* IE7 */
*+html #dieciocho {  color: red }

/* IE 10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
   #veintiun { color: red; }
}

Zen-Cart upgrade from 1.3.x to 1.5.3

If you upgrade Zencart from version 1.3.x to V1.5.4, chance is you’ll experience a lot of error on front-end and back-end Admin. Below is the list of files that you need to consider during the manual upgrade. Version 1.5.4 contains new features and bug fixes.

NEW Files ADDED (since release of v1.5.3)

/admin/includes/auto_loaders/config.admin.zcObserverLogEventListener.php (added in v1.5.4)
/admin/includes/auto_loaders/config.admin.zcObserverLogWriterDatabase.php (added in v1.5.4)
/admin/includes/auto_loaders/config.admin.zcObserverLogWriterTextfile.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogEventListener.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogWriterDatabase.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogWriterTextfile.php (added in v1.5.4)
/admin/includes/init_includes/init_cache_key_check.php (added in v1.5.2, updated in 1.5.4)
/includes/classes/ajax/zcAjaxPayment.php (added in v1.5.4)
/includes/templates/template_default/jscript/jquery.min.js (added in v1.5.4)
/includes/templates/template_default/jscript/jscript_framework.php (added in v1.5.4)
/includes/templates/template_default/templates/tpl_ajax_checkout_confirmation_default.php (added in v1.5.4)
/ajax.php (added in v1.5.4)

CHANGED Files (since release of v1.5.3)

/admin/admin_activity.php
/admin/attributes_controller.php
/admin/configuration.php
/admin/countries.php
/admin/coupon_admin.php
/admin/currencies.php
/admin/customers.php
/admin/define_pages_editor.php
/admin/downloads_manager.php
/admin/ezpages.php
/admin/geo_zones.php
/admin/gv_mail.php
/admin/gv_queue.php
/admin/languages.php
/admin/layout_controller.php
/admin/login.php
/admin/media_manager.php
/admin/modules.php
/admin/orders.php
/admin/profiles.php
/admin/salemaker.php
/admin/specials.php
/admin/sqlpatch.php
/admin/store_manager.php
/admin/tax_classes.php
/admin/tax_rates.php
/admin/whos_online.php
/admin/includes/dist-configure.php
/admin/includes/header.php
/admin/includes/auto_loaders/config.admin.zcObserverLogEventListener.php (added in v1.5.4)
/admin/includes/auto_loaders/config.admin.zcObserverLogWriterDatabase.php (added in v1.5.4)
/admin/includes/auto_loaders/config.admin.zcObserverLogWriterTextfile.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogEventListener.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogWriterDatabase.php (added in v1.5.4)
/admin/includes/classes/class.admin.zcObserverLogWriterTextfile.php (added in v1.5.4)
/admin/includes/classes/upload.php
/admin/includes/functions/admin_access.php
/admin/includes/functions/database.php
/admin/includes/functions/general.php
/admin/includes/functions/html_output.php
/admin/includes/init_includes/init_admin_auth.php
/admin/includes/init_includes/init_admin_history.php
/admin/includes/init_includes/init_cache_key_check.php
/admin/includes/languages/english.php
/admin/includes/languages/english/admin_activity.php
/admin/includes/languages/english/profiles.php
/admin/includes/modules/copy_to_confirm.php
/admin/includes/modules/move_product_confirm.php
/admin/includes/modules/update_product.php
/admin/includes/modules/product_music/copy_to_confirm.php
/admin/includes/modules/product_music/update_product.php
/extras/.htaccess
/extras/curltester.php
/includes/dist-configure.php
/includes/version.php
/includes/classes/ajax/zcAjaxPayment.php (added in v1.5.4)
/includes/classes/class.phpbb.php
/includes/classes/class.smtp.php
/includes/classes/class.zcPassword.php
/includes/classes/payment.php
/includes/classes/shopping_cart.php
/includes/functions/functions_general.php
/includes/languages/english.php
/includes/modules/order_total/ot_coupon.php
/includes/modules/pages/checkout_payment/header_php.php
/includes/modules/pages/checkout_payment/jscript_main.php
/includes/modules/pages/checkout_shipping/header_php.php
/includes/modules/pages/page/header_php.php
/includes/modules/pages/shopping_cart/header_php.php
/includes/modules/payment/authorizenet.php
/includes/modules/payment/authorizenet_aim.php
/includes/modules/payment/authorizenet_echeck.php
/includes/modules/payment/linkpoint_api/class.linkpoint_api.php
/includes/modules/payment/linkpoint_api.php
/includes/modules/payment/paypal.php
/includes/modules/payment/paypaldp.php
/includes/modules/payment/paypalwpp.php
/includes/modules/payment/paypal/paypal_curl.php
/includes/modules/shipping/storepickup.php
/includes/templates/template_default/common/html_header.php
/includes/templates/template_default/jscript/jquery.min.js (added in v1.5.4)
/includes/templates/template_default/jscript/jscript_framework.php (added in v1.5.4)
/includes/templates/template_default/templates/tpl_ajax_checkout_confirmation_default.php (added in v1.5.4)
/includes/templates/template_default/templates/tpl_checkout_payment_default.php
/ajax.php (added in v1.5.4)
/zc_install/ … assume *all* of /zc_install/ has changed

And here are all the locations of error may be displayed on frontpage.