84% optipic

Code Review | OptiPic images optimization

WordPress plugin OptiPic images optimization scored84%from 54 tests.

About plugin

  • Plugin page: optipic
  • Plugin version: 1.30.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 5, 2020
  • Latest release: May 23, 2023
  • Number of updates: 29
  • Update frequency: every 31.0 days
  • Top authors: optipic (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

100+ active /4,521 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.61ms] Passed 4 tests

This is a short check of server-side resources used by OptiPic images optimization
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0540.05 ▲0.44
Dashboard /wp-admin3.34 ▼0.0146.78 ▼11.50
Posts /wp-admin/edit.php3.39 ▲0.0344.36 ▼1.54
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.54 ▼19.57
Media Library /wp-admin/upload.php3.26 ▲0.0334.39 ▼1.84

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for OptiPic images optimization
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,108 ▲36213.56 ▼0.5118.32 ▲16.7039.01 ▼1.18
Dashboard /wp-admin2,210 ▲305.56 ▼0.1083.48 ▼7.6260.75 ▲21.29
Posts /wp-admin/edit.php2,115 ▲361.98 ▼0.0134.88 ▼2.7229.87 ▼2.46
Add New Post /wp-admin/post-new.php1,558 ▲4122.68 ▲3.70669.72 ▲242.0156.25 ▼3.69
Media Library /wp-admin/upload.php1,415 ▲244.17 ▼0.02100.68 ▲0.5480.77 ▲36.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/optipic/optipic.php:13
    • > PHP Warning
      Use of undefined constant OPTIPIC_LOAD_TEMPLATE_PATH - assumed 'OPTIPIC_LOAD_TEMPLATE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/optipic/includes/template_loader.php on line 4
    • > PHP Warning
      require_once(OPTIPIC_LOAD_TEMPLATE_PATH): failed to open stream: No such file or directory in wp-content/plugins/optipic/includes/template_loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/optipic/includes/settings.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'OPTIPIC_LOAD_TEMPLATE_PATH' (include_path='.:/usr/share/php') in wp-content/plugins/optipic/includes/template_loader.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
You can look at the official readme.txt

optipic/optipic.php 92% from 13 tests

The main PHP script in "OptiPic images optimization" version 1.30.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 195 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin876 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6241241805
PO File120571

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity112.00
▷ Minimum class complexity112.00
▷ Maximum class complexity112.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods29
▷ Static methods2896.55%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/op_logo.png0.98KB0.20KB▼ 79.70%