84% grayscale

Code Review | Grayscale

WordPress plugin Grayscale scored84%from 54 tests.

About plugin

  • Plugin page: grayscale
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7
  • WordPress version: 6.3.1
  • First release: Oct 1, 2012
  • Latest release: Oct 28, 2013
  • Number of updates: 12
  • Update frequency: every 32.9 days
  • Top authors: Fab1en (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,081 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
Installer ran successfully

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

Server-side resources used by Grayscale
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.27 ▲5.39
Dashboard /wp-admin3.32 ▲0.0145.97 ▼1.21
Posts /wp-admin/edit.php3.37 ▲0.0149.92 ▲1.56
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.74 ▼5.11
Media Library /wp-admin/upload.php3.24 ▲0.0134.78 ▲0.34

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Grayscale
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.52 ▼0.852.11 ▲0.2045.34 ▲4.81
Dashboard /wp-admin2,206 ▲185.84 ▲0.8395.61 ▼21.4938.98 ▼3.71
Posts /wp-admin/edit.php2,089 ▼01.96 ▼0.0941.78 ▲4.6133.82 ▲1.34
Add New Post /wp-admin/post-new.php1,514 ▼1917.51 ▼5.68670.11 ▼10.5458.97 ▲3.80
Media Library /wp-admin/upload.php1,382 ▼94.26 ▼0.1097.24 ▼4.4643.29 ▼0.36

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

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/grayscale/grayscale.php:25
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/grayscale/class-grayscale-image-editor.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/class-wp-image-editor.php' (include_path='.:/usr/share/php') in wp-content/plugins/grayscale/class-grayscale-image-editor.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-wp-image-editor.php): failed to open stream: No such file or directory in wp-content/plugins/grayscale/class-grayscale-image-editor.php on line 3

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: thumbnail, images, image, grayscale

grayscale/grayscale.php Passed 13 tests

The primary PHP file in "Grayscale" version 1.2 is used by WordPress to initiate all plugin functionality
64 characters long description:
Automatically create grayscale thumbnails for a given image size

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
Everything looks great! No dangerous files found in this plugin89 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2142469
Markdown110020

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity2.00
▷ Minimum method complexity2.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin