77% photu

Code Review | Photu - URL based image manipulation and optimization

WordPress plugin Photu - URL based image manipulation and optimization scored77%from 54 tests.

About plugin

  • Plugin page: photu
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 6.3.1
  • First release: Jul 29, 2021
  • Latest release: Sep 24, 2021
  • Number of updates: 15
  • Update frequency: every 3.9 days
  • Top authors: mogitech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /411 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼12.64ms] 75% from 4 tests

An overview of server-side resources used by Photu - URL based image manipulation and optimization
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 544.26ms on /wp-admin/options-general.php?page=photu-setting)
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.65 ▼3.02
Dashboard /wp-admin3.31 ▼0.0348.76 ▼16.37
Posts /wp-admin/edit.php3.37 ▲0.0147.39 ▼8.13
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.52 ▼23.04
Media Library /wp-admin/upload.php3.24 ▲0.0139.67 ▲3.67
photu settings /wp-admin/options-general.php?page=photu-setting3.22544.26

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Photu - URL based image manipulation and optimization
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▲0.031.69 ▼0.0741.68 ▲2.56
Dashboard /wp-admin2,202 ▲225.62 ▼0.0591.22 ▼1.0241.74 ▼4.57
Posts /wp-admin/edit.php2,101 ▼21.98 ▼0.0239.81 ▲3.7835.85 ▲0.43
Add New Post /wp-admin/post-new.php1,531 ▲523.19 ▲0.24658.45 ▲8.0849.96 ▼5.27
Media Library /wp-admin/upload.php1,404 ▲104.21 ▲0.0195.96 ▼10.8141.48 ▼3.51
photu settings /wp-admin/options-general.php?page=photu-setting9941.9922.6829.25

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=photu-setting
    • > Notice in wp-content/plugins/photu/includes/setting.php+240
    Undefined variable: plugin_data
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=photu-setting
    • > Notice in wp-content/plugins/photu/includes/setting.php+240
    Trying to access array offset on value of type null

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
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/photu/trunk/includes/setting.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/photu/trunk/photu.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/photu/includes/setting.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/photu/trunk/includes/setting.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/photu/photu.php:11
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/photu/includes/setting.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/photu/trunk/includes/setting.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/photu/includes/setting.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
  • Donate link: Invalid URI found ("")
The official readme.txt is a good inspiration

photu/photu.php 92% from 13 tests

The main file in "Photu - URL based image manipulation and optimization" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 306 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,540 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS126301,403
PHP53429991,137

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity122.00
▷ Minimum class complexity43.00
▷ Maximum class complexity201.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods180
▷ Static methods16290.00%
▷ Public methods16893.33%
▷ Protected methods84.44%
▷ Private methods42.22%
Functions18
▷ Named functions1477.78%
▷ Anonymous functions422.22%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/includes/mogiio-logo-dark.png30.03KB13.21KB▼ 56.01%
includes/mogiio-logo-dark.png30.03KB13.21KB▼ 56.01%