Jump to content

Problems with outdated modules in PHP8


tires
 Share

Recommended Posts

I would like to update a website to php8 that was previously running on 5.4.

Unfortunately I'm having problems with several modules like MarkupSEO and AllInOneMinify that haven't been updated in a long time and don't seem to work with PHP8.
Even in PHP7.4 some errors are thrown out.

I'm afraid this is a general problem with the modules on older websites, isn't it?
Or a general problem of a cms with less popularity?
How do you deal with this?

Link to comment
Share on other sites

10 hours ago, tires said:

I'm afraid this is a general problem with the modules on older websites, isn't it?
Or a general problem of a cms with less popularity?

As someone who has spent considerable time dealing with similar issues, submitting error reports and PRs, etc. in the context of WordPress plugins, I can say that it's simply a general issue with dependencies. Popularity of the CMS matters very little, if at all. Relative popularity of the module/plugin matters more, though even that is not a 100% guarantee.

You can avoid some of this by only using the dependencies you truly require, and choosing the ones to use carefully: see if they are actively maintained, whether that is by regular code updates or via the support forum.

10 hours ago, tires said:

How do you deal with this?

Only using the dependencies I truly require, and choosing the ones to use carefully ?

There's no silver bullet here. If the module author is still active you can submit error reports via support forum and/or GitHub. If the author is no longer active, someone (including you) could fork the module and make fixes there, but unless new maintainer is going to really commit into maintaining the module, it's not a good long term solution.

For modules that are no longer actively maintained, my recommendation would be to move on — find something else that gets the job done. Or better yet, don't use a module. Again, you should only use the modules that you truly need.

Alternatives for the modules you've mentioned:

  • Instead of MarkupSEO you could look into Seo Maestro, but since the author (Wanze) has stated that they are no longer actively involved with ProcessWire, it's questionable whether this is a good long term solution either. We use Markup Metadata, which does at least some of the same tasks; it's also less involved/opinionated, which means that it's easier to maintain.
  • Instead of AllInOneMinify I would really recommend looking into ProCache. It's not free, but if it's for a commercial purpose (or long term personal projects etc.) it is — in my opinion — well worth the cost. It also does a lot for your site's performance that AllInOneMinify won't do.
  • Like 11
Link to comment
Share on other sites

Hey Teppo!

Thanks for your detailed answer!
Less is more, right? ?

I will definitely try out the ProCache module.
In the future I will try to reduce the number of modules used.

  • Like 1
Link to comment
Share on other sites

Quote

Do you have numbers for that? I can't really believe it and it sounds interesting ? 

Nope, as I don't have ProCache, but based on what I've read and info from the forum, ProCache serves static files and there might be directives needed in .htaccess. I'm on IIS so it's not an option for me. AIOM+ leverages the template page cache built in core and uses a small php file to render those files. It's not perfect as modification of index.php is needed for best results (I have a feature request open). It also works if you modify some settings in site config.php, but it's not that effective.

Link to comment
Share on other sites

Thx @matjazp I read your readme and understood the concept. 

Quote

29 seconds: no cache enabled
6 seconds: built-in cache enabled
0.017 seconds: ProCache enabled

I guess with your method it would be somewhere in between the 0.017 seconds from ProCache and the 6 seconds from the built-in template cache. Would have been interesting to get some real results, especially how much faster your approach is compared to the built-in cache.

Link to comment
Share on other sites

On 7/4/2023 at 10:34 PM, tires said:

How do you deal with this?

I recommend using Rector for upgrading legacy code or modules. I have written a short introduction/tutorial how you can use it here: 

 

You can then select which files or paths should be updated and to which PHP version and it does automated safe refactoring on them. Most of the plugins should then work out of the box with PHP 8, I have converted several modules with it. New rulesets for rector are published whenever they are needed. It is a great tool. 

  • Like 1
Link to comment
Share on other sites

1.10 seconds: no cache enabled
1.00 seconds: built-in cache enabled
0.095 seconds: AIOM+ enabled

I'm not using debug timer, just timings in browser network tab. @bernhardperhaps you could test AIOM+ on the same setup as you tested with ProCache (29 seconds ???).

Link to comment
Share on other sites

Hey @matjazp that's the numbers that Ryan shared here: https://processwire.com/store/pro-cache/#procache-html-output-caching-xml-or-json-too

Quote

The performance benefits are drastic and visible. Using ApacheBench with the homepage of the Skyscrapers site profile, we completed 500 requests (10 concurrent) to the homepage. The amount of time occupied to complete each of these was as follows:

 

Link to comment
Share on other sites

I installed SkyScraper profile (last commit from year 2013, not compatible with PW3) on PW 3.0.221 and loaded home page:

1.10 seconds: no cache enabled
1.00 seconds: built-in cache enabled
0.35 seconds: AIOM+ enabled

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...