Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Database Optimizer


Jack_mcs

Recommended Posts

A new version has been uploaded with these changes:

  • Changed call to defined location in database_optimizer.php. Found by @raiwa.
  • Fixed some compatibility issues with php 7.3.
  • Added a version for Phoenix.
  • Removed the calls to load the filename and database files in the After 2.3 version.
  • Replaced mysql_error with mysqli_error for php 7 compatibility. Found by @Demitry.
  • Updated the included Version Checker file that works with the new apps section.

 

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

@Jack_mcs

hi Jack,

I updated all the files for the new 1.8 version of this addon and ran it for the first time last night.

One of the errors I got was for the tep_draw_bootstrap_button() function for that Update button.

I have BS Edge and since there is nothing in the package for any osC versions older than Flatline (Frozen), I had to apply the changes for that version to BS Edge.

However, in doing so, I noticed that Flatline does not have the tep_draw_bootstrap_button() function defined either. I got this function from Zombified Phoenix and the Update button now displays & works as it should.

The other issue was a PHP warning I got regarding a non-numeric value related to the following file and line. The database optimization summary is also listed below.

database-optimizer-warning.thumb.png.3aa38ba5fbb332a64c6c5c6c61604da1.png

database-optimizer-details.png.9476dda9021aec4d972aa7eedfc9ca2a.png

 

I looked up that line and here it is.

$dateOrder = date("Y-m-d", time() - ($config['orphan_orders'] * 86400));

So, three issues:

1)  There is no package solution for any osC versions older than Flatline (Frozen)

2)  The tep_draw_bootstrap_button() function does not exist in Flatline for the Update button, which is in the admin/database_optimizer.php file

3)  The calculation for $dateOrder variable in admin/includes/modules/database_optimizer_common.php on line 165 is producing a PHP warning of a non-numeric value

 

I should also mention that I have not made any adjustments to the default setting in the configuration part of this addon.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

5 hours ago, Demitry said:

1)  There is no package solution for any osC versions older than Flatline (Frozen)

2)  The tep_draw_bootstrap_button() function does not exist in Flatline for the Update button, which is in the admin/database_optimizer.php file

 

3)  The calculation for $dateOrder variable in admin/includes/modules/database_optimizer_common.php on line 165 is producing a PHP warning of a non-numeric value

1) There is a version for "Before 2.3". I don't recall I updated it for this version. Probably not. With Phoenix becoming more and more popular and with it changing often, managing multiple versions is just not possible any longer, at least for me. If you need an addon to work for older versions, you can 

  • Use an older version. This is not a good idea since you will lose fixes and improvements.
  • Convert the code to work with an older version.
  • Pay someone to do the conversion.

2) This got through because of lack of time for testing older versions. To fix it, you can replace 

                 <td align="center">
                 <?php echo tep_draw_bootstrap_button(IMAGE_UPDATE, 'fas fa-save', null, 'primary', null, 'btn-success btn-block btn-lg'); ?>
                 </td>

with

                 <td align="center"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE);?></td>

3) I'm not able to reproduce this but in searching for it, it seems to be a bug in php 7.1 and, maybe 7.2. I'm running 7.3 so it seems they fixed that problem. Applying the change below should prevent it but since I can't see the warning, I can't be sure. Change this line

$dateOrder = date("Y-m-d", time() - ($config['orphan_orders'] * 86400));

to

$dateOrder = date("Y-m-d", time() - (int)($config['orphan_orders'] * 86400));

 

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Quote

1) There is a version for "Before 2.3"

This is not in that package for version 1.8 ...and I have BS Edge as I originally stated, which is after version 2.3.4. The oldest version in that package is Flatline.

For number two, I had made the fix as I stated, in my post above. I was just letting you know about this as a potential issue for others updating to this latest version because without that PHP function defined, you get a PHP Fatal Error.

As for number three, thank you for the fix. I have not applied it yet, but will, and I'll test it afterwards. I am on PHP7.2 at this time, so this might be the cause of this PHP warning.

Thank you for your reply.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

9 minutes ago, Demitry said:

This is not in that package for version 1.8 ...and I have BS Edge as I originally stated, which is after version 2.3.4. The oldest version in that package is Flatline.

The package I have here, which is what I uploaded, has these directories in it:

Before_2.3
Frozen
Phoenix

That covers all versions of oscommerce though, as mentioned, they may not all be current.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Quote

Before_2.3

Sorry Jack,.. my mistake on that point. I had to look at the package again to see this. I skipped over that folder because I have BS Edge, which is after version 2.3

UPDATE: I ran a test database optimization after making that change you mentioned and there was no PHP warning. So, it works! Thanks.

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Just an addition/addendum to my previous comment.

Although there is a folder in the package for osC versions Before_2.3, ..there is a large gap from version 2.2 to the Flatline version, including osC versions 2.3, 2.4, BS Edge, Gold, and everything in between.

This is no longer an issue for me, but it could be for anyone else who has an osC version that is part of that gap.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

10 hours ago, Demitry said:

This is no longer an issue for me, but it could be for anyone else who has an osC version that is part of that gap.

That is the situation with all addons. Most of the new ones for Phoenix don't even have a Frozen version, much less pre-Frozen versions. I've always tried to include versions for all shops in my addons but that is going away. Even now, I don't have the time to test Frozen versions and may stop supporting all pre-Phoenix versions. I offer paid support for them but trying to code for all shops in the free versions just takes too much time.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Quote

... but trying to code for all shops in the free versions just takes too much time.

I totally understand! I have a bunch of addons that I don't care to dedicate time to for a completely dead software. Cheers for doing this update! I appreciate it.

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

  • 7 months later...
11 hours ago, Philo2005 said:

Will these files be included in the procedure at some point?

Thanks for the suggestions.  I will put them on the list. Whether they ever get released or not will depend on what happens with V4.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...