79% jch-optimize

Code Review | JCH Optimize

WordPress plugin JCH Optimize scored79%from 54 tests.

About plugin

  • Plugin page: jch-optimize
  • Plugin version: 4.1.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2014
  • Latest release: Nov 16, 2023
  • Number of updates: 167
  • Update frequency: every 19.7 days
  • Top authors: codealfa (100%)

Code review

54 tests

User reviews

68 reviews

Install metrics

7,000+ active /326,917 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.14ms] Passed 4 tests

This is a short check of server-side resources used by JCH Optimize
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.02 ▼5.91
Dashboard /wp-admin3.31 ▲0.0146.08 ▼1.41
Posts /wp-admin/edit.php3.36 ▲0.0144.57 ▼1.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.81 ▼10.86
Media Library /wp-admin/upload.php3.23 ▲0.0033.44 ▼2.33

Server storage [IO: ▲5.58MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 962 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for JCH Optimize
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲3914.23 ▼0.051.68 ▼0.1039.00 ▼5.64
Dashboard /wp-admin2,206 ▲295.59 ▲0.0690.19 ▼15.2342.09 ▼4.72
Posts /wp-admin/edit.php2,111 ▲112.01 ▼0.0136.23 ▼4.5734.90 ▼0.80
Add New Post /wp-admin/post-new.php1,532 ▲623.15 ▲0.07630.21 ▼76.5648.33 ▼8.70
Media Library /wp-admin/upload.php1,414 ▲174.23 ▲0.0299.71 ▼13.0942.13 ▼6.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 172× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/jch-optimize/src/Core/Admin/ImageUploader.php
    • > /wp-content/plugins/jch-optimize/tmpl/pagecache_body_with_records.php
    • > /wp-content/plugins/jch-optimize/tmpl/pagecache_filters.php
    • > /wp-content/plugins/jch-optimize/src/Core/Interfaces/Cache.php
    • > /wp-content/plugins/jch-optimize/tmpl/pagecache.php
    • > /wp-content/plugins/jch-optimize/lib/src/Css/Callbacks/CorrectUrls.php
    • > /wp-content/plugins/jch-optimize/src/Platform/Paths.php
    • > /wp-content/plugins/jch-optimize/src/Core/Http2Preload.php
    • > /wp-content/plugins/jch-optimize/src/Core/Css/CssSearchObject.php
    • > /wp-content/plugins/jch-optimize/lib/src/Service/CoreProvider.php
  • 342× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/guzzlehttp/psr7/src/CachingStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'JchOptimize\\Core\\Mvc\\Controller' not found in wp-content/plugins/jch-optimize/src/Controller/PageCache.php:30
    • > PHP Warning
      require_once(wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/jch-optimize/media/assets/jscss.php on line 23
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Joomla\\Registry\\FormatInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/joomla/registry/src/Format/Ini.php:18
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Laminas\\EventManager\\Exception\\ExceptionInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/laminas/laminas-eventmanager/src/Exception/RuntimeException.php:6
    • > PHP Fatal error
      Uncaught Error: Class '_JchOptimizeVendor\\Laminas\\Cache\\Exception\\RuntimeException' not found in wp-content/plugins/jch-optimize/lib/vendor/laminas/laminas-cache/src/Exception/MissingKeyException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Laminas\\Stdlib\\ParametersInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/laminas/laminas-stdlib/src/Parameters.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'JchOptimize\\Core\\Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/jch-optimize/src/Plugin/Loader.php:53
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/guzzlehttp/psr7/src/NoSeekStream.php:11
    • > PHP Fatal error
      Uncaught Error: Interface '_JchOptimizeVendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/jch-optimize/lib/vendor/guzzlehttp/psr7/src/BufferStream.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: seo, optimize, pagespeed, cache, performance

jch-optimize/jch-optimize.php Passed 13 tests

Analyzing the main PHP file in "JCH Optimize" version 4.1.0
82 characters long description:
Boost your WordPress site's performance with JCH Optimize as measured on PageSpeed

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected72,782 lines of code in 809 files:
LanguageFilesBlank linesComment linesLines of code
PHP7717,11039,11763,086
JSON2004,206
JavaScript185204012,840
CSS74821131,982
PO File1275305570
Markdown419077
HTML53814
INI1247

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity13.40
▷ Minimum class complexity1.00
▷ Maximum class complexity367.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces114
Interfaces135
Traits33
Classes531
▷ Abstract classes478.85%
▷ Concrete classes48491.15%
▷ Final classes5711.78%
Methods4,903
▷ Static methods1,48930.37%
▷ Public methods4,28687.42%
▷ Protected methods2875.85%
▷ Private methods3306.73%
Functions504
▷ Named functions22444.44%
▷ Anonymous functions28055.56%
Constants289
▷ Global constants3913.49%
▷ Class constants25086.51%
▷ Public constants24698.40%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
72 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/core/icons/minimum.png1.44KB1.46KB0.00%
media/jquery-ui/images/ui-icons_777620_256x240.png3.80KB4.18KB0.00%
media/core/icons/lcp_images.png1.34KB1.38KB0.00%
media/core/icons/browser_caching.png1.96KB1.97KB0.00%
media/chosen-js/chosen-sprite.png0.53KB0.88KB0.00%