84% wp-google-pagespeed-image-optimizer-lite

Code Review | WP Google PageSpeed Image Optimizer Lite

WordPress plugin WP Google PageSpeed Image Optimizer Lite scored84%from 54 tests.

About plugin

  • Plugin page: wp-google-pagespe...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.8.4
  • WordPress version: 6.3.1
  • First release: Sep 12, 2017
  • Latest release: Oct 9, 2017
  • Number of updates: 23
  • Update frequency: every 1.2 days
  • Top authors: R3dRidl3 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /2,102 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼13.97ms] Passed 4 tests

Server-side resources used by WP Google PageSpeed Image Optimizer Lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.07 ▼5.85
Dashboard /wp-admin3.39 ▲0.0447.48 ▼17.02
Posts /wp-admin/edit.php3.50 ▲0.1545.93 ▼3.15
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.15 ▼29.84
Media Library /wp-admin/upload.php3.31 ▲0.0835.70 ▼0.26
Bulk Image Optimizer /wp-admin/upload.php?page=bulk-image-optimizer3.2832.97
Google Image Optimizer Settings /wp-admin/upload.php?page=google-image-optimizer-settings3.2832.25

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Google PageSpeed Image Optimizer Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲4613.59 ▼0.794.53 ▲2.3442.83 ▼0.87
Dashboard /wp-admin2,223 ▲324.85 ▼0.13110.66 ▲6.2039.99 ▼4.06
Posts /wp-admin/edit.php2,106 ▲172.04 ▲0.0734.17 ▼3.0033.79 ▼0.24
Add New Post /wp-admin/post-new.php1,551 ▲2323.12 ▲4.72641.59 ▲30.4464.23 ▲3.06
Media Library /wp-admin/upload.php1,410 ▲224.23 ▼0.0199.28 ▼1.7944.30 ▲0.90
Bulk Image Optimizer /wp-admin/upload.php?page=bulk-image-optimizer8542.1928.3333.77
Google Image Optimizer Settings /wp-admin/upload.php?page=google-image-optimizer-settings9312.1625.1625.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wp-google-pagespeed-image-optimizer-lite/wp-google-pagespeed-image-optimizer-lite.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GoogleImageOptimizer' not found in wp-content/plugins/wp-google-pagespeed-image-optimizer-lite/google-image-optimizer-actions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GoogleImageOptimizer' not found in wp-content/plugins/wp-google-pagespeed-image-optimizer-lite/google-image-optimizer-filters.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GoogleImageOptimizer' not found in wp-content/plugins/wp-google-pagespeed-image-optimizer-lite/google-image-optimizer-admin-styles.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GoogleImageOptimizer' not found in wp-content/plugins/wp-google-pagespeed-image-optimizer-lite/google-image-optimizer-admin-scripts.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: google, pagespeed, compression, compress, optimization...

wp-google-pagespeed-image-optimizer-lite/wp-google-pagespeed-image-optimizer-lite.php Passed 13 tests

"WP Google PageSpeed Image Optimizer Lite" version 1.3.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
52 characters long description:
WP Google PageSpeed Image Optimizer made by R3dRidl3

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected679 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8929470
CSS170209

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.17
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods17
▷ Static methods17100.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/590.png57.05KB21.80KB▼ 61.78%