84% modern-images-wp

Code Review | Modern Images WP

WordPress plugin Modern Images WP scored84%from 54 tests.

About plugin

  • Plugin page: modern-images-wp
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jul 1, 2021
  • Latest release: Oct 27, 2023
  • Number of updates: 12
  • Update frequency: every 70.7 days
  • Top authors: adamsilverstein (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /5,671 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.03MB] [CPU: ▼4.85ms] Passed 4 tests

Server-side resources used by Modern Images WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.87 ▼2.03
Dashboard /wp-admin3.34 ▲0.0342.36 ▼7.80
Posts /wp-admin/edit.php3.39 ▲0.0347.96 ▼1.72
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.57 ▼7.86
Media Library /wp-admin/upload.php3.26 ▲0.0336.25 ▲1.25

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Modern Images WP: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.35 ▲0.001.98 ▲0.3644.00 ▼0.96
Dashboard /wp-admin2,192 ▲185.55 ▲0.0382.10 ▼7.3838.29 ▲1.33
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0636.39 ▲0.1633.07 ▼1.33
Add New Post /wp-admin/post-new.php1,526 ▼523.72 ▲0.45680.13 ▲53.1948.33 ▲0.75
Media Library /wp-admin/upload.php1,400 ▼04.17 ▲0.01100.51 ▲6.5740.42 ▲0.76

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/modern-images-wp/modern-images-wp.php:38

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: jpegxl, webp, avif, modern images

modern-images-wp/modern-images-wp.php Passed 13 tests

The principal PHP file in "Modern Images WP" v. 1.2.0 is loaded by WordPress automatically on each request
117 characters long description:
Choose a default format for subsized images. Choose WebP, JPGXL or AVIF when your server image library supports them.

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 detected380 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP370239376
JSON1104

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity28.50
▷ Minimum class complexity4.00
▷ Maximum class complexity53.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods1257.14%
▷ Protected methods838.10%
▷ Private methods14.76%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin