84% categories-images

Code Review | Categories Images

WordPress plugin Categories Images scored84%from 54 tests.

About plugin

  • Plugin page: categories-images
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 12, 2012
  • Latest release: Jul 28, 2023
  • Number of updates: 42
  • Update frequency: every 96.8 days
  • Top authors: elzahlan (100%)

Code review

54 tests

User reviews

83 reviews

Install metrics

60,000+ active /751,552 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.09ms] Passed 4 tests

An overview of server-side resources used by Categories Images
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0740.41 ▼1.76
Dashboard /wp-admin3.44 ▲0.1345.95 ▼5.07
Posts /wp-admin/edit.php3.56 ▲0.2047.09 ▼0.96
Add New Post /wp-admin/post-new.php6.02 ▲0.1383.29 ▼4.56
Media Library /wp-admin/upload.php3.36 ▲0.1336.25 ▼0.31

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Categories Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.24 ▼1.421.70 ▼0.0445.44 ▲3.25
Dashboard /wp-admin2,218 ▲304.88 ▲0.0198.58 ▼12.1641.93 ▲1.87
Posts /wp-admin/edit.php2,098 ▲122.04 ▼0.0234.20 ▼0.6634.25 ▼1.96
Add New Post /wp-admin/post-new.php1,529 ▲1523.19 ▲5.67598.61 ▼60.8957.22 ▲3.32
Media Library /wp-admin/upload.php1,400 ▲94.19 ▲0.0099.10 ▼3.1742.02 ▼1.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
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 _e() in wp-content/plugins/categories-images/templates/admin.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (22 tag instead of maximum 10)
  • Screenshots: Add images for these screenshots: #1 (Image preview and new image field in add/edit category or taxonomy with upload button which allow you to select current or upload a new image.), #2 (New image field with (upload/remove) buttons to allow you to edit category or taxonomy image in quick edit.), #3 (When you click the upload button the wordpress upload box will popup, upload or select image then press use this image.), #4 (New menu (Categories Images) for the plugin settings.), #5 (Now you can exclude any taxonomy from the plugin and save changes.)
The official readme.txt might help

categories-images/categories-images.php Passed 13 tests

"Categories Images" version 3.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
82 characters long description:
Categories Images Plugin allow you to add an image to category or any custom term.

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
Success! There were no dangerous files found in this plugin688 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PO File98094344
PHP35151278
JavaScript17761
CSS1015

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.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
7 PNG files occupy 0.47MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png65.57KB19.20KB▼ 70.71%
images/placeholder.png27.87KB11.37KB▼ 59.19%
screenshot-2.png164.42KB65.29KB▼ 60.29%
assets/images/placeholder.png27.87KB11.37KB▼ 59.19%
screenshot-1.png115.11KB43.90KB▼ 61.86%