83% wp-image-recognizer

Code Review | WP Image Recognizer

WordPress plugin WP Image Recognizer scored83%from 54 tests.

About plugin

  • Plugin page: wp-image-recognizer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-5.3.2
  • WordPress version: 6.3.1
  • First release: Jun 1, 2018
  • Latest release: Jan 22, 2020
  • Number of updates: 11
  • Update frequency: every 54.6 days
  • Top authors: greensheepwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,077 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by WP Image Recognizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0032.53 ▼2.87
Dashboard /wp-admin3.31 ▲0.0143.80 ▼4.88
Posts /wp-admin/edit.php3.36 ▲0.0145.82 ▼0.95
Add New Post /wp-admin/post-new.php5.91 ▲0.0378.74 ▼12.69
Media Library /wp-admin/upload.php3.24 ▲0.0136.44 ▲2.12

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Image Recognizer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.55 ▼0.071.72 ▲0.1740.17 ▼0.64
Dashboard /wp-admin2,205 ▲256.05 ▲0.44142.98 ▲54.5245.86 ▲1.53
Posts /wp-admin/edit.php2,119 ▲193.04 ▲1.0256.24 ▲21.3532.84 ▼3.03
Add New Post /wp-admin/post-new.php1,549 ▲2319.28 ▼3.78646.04 ▼7.4444.74 ▼10.25
Media Library /wp-admin/upload.php1,416 ▲135.65 ▲1.41111.45 ▲12.0742.36 ▼1.64

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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
Even though no errors were found, 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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'plugins\\wir\\AbstractAjax' not found in wp-content/plugins/wp-image-recognizer/classes/ajax/SetImageCaption.class.php:13
    • > PHP Warning
      Use of undefined constant WIR_PLUGIN_PATH - assumed 'WIR_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-image-recognizer/classes/ClassLoader.class.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins\\wir\\plugin_dir_path() in wp-content/plugins/wp-image-recognizer/wp-image-recognizer.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

wp-image-recognizer/wp-image-recognizer.php 77% from 13 tests

The main file in "WP Image Recognizer" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,867 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4136882,038
Markdown11880631
PHP739101198

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1178.57%
▷ Protected methods321.43%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.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 are no PNG files in this plugin