78% kapow-image-recommendation

Code Review | KAPOW Image Recommendation

WordPress plugin KAPOW Image Recommendation scored78%from 54 tests.

About plugin

  • Plugin page: kapow-image-recom...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 3, 2021
  • Latest release: May 25, 2022
  • Number of updates: 8
  • Update frequency: every 44.6 days
  • Top authors: brightminded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /458 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.50MB] [CPU: ▼10.29ms] Passed 4 tests

Analyzing server-side resources used by KAPOW Image Recommendation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.12 ▼0.48
Dashboard /wp-admin3.42 ▲0.1164.25 ▲13.78
Posts /wp-admin/edit.php3.53 ▲0.1747.22 ▼1.78
Add New Post /wp-admin/post-new.php3.56 ▼2.3355.84 ▼41.21
Media Library /wp-admin/upload.php3.34 ▲0.1136.77 ▲2.32

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for KAPOW Image Recommendation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10814.80 ▲0.422.01 ▲0.1743.87 ▲0.13
Dashboard /wp-admin2,224 ▲424.88 ▼0.92101.49 ▼17.0840.14 ▼5.26
Posts /wp-admin/edit.php2,107 ▲182.04 ▲0.0334.01 ▼3.8635.55 ▲2.36
Add New Post /wp-admin/post-new.php3,115 ▲1,5827.73 ▼15.22205.07 ▼463.3772.36 ▲20.48
Media Library /wp-admin/upload.php1,409 ▲304.18 ▼0.0199.91 ▼4.7443.74 ▲1.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/kapow-image-recommendation/admin/partials/kapow-admin-display.php
    • > /wp-content/plugins/kapow-image-recommendation/public/partials/kapow-public-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/kapow-image-recommendation/admin/partials/kapow-admin-display.php on line 20
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/kapow-image-recommendation/admin/partials/kapow-admin-display.php on line 20

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: recommendation, unsplash, photos, media, images

kapow-image-recommendation/kapow.php 77% from 13 tests

The primary PHP file in "KAPOW Image Recommendation" version 1.0.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("kapow-image-recommendation.php" instead of "kapow.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 141 characters long)

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
Success! There were no dangerous files found in this plugin632 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12224779532
JavaScript21844100
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.14
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods42
▷ Static methods24.76%
▷ Public methods2764.29%
▷ Protected methods00.00%
▷ Private methods1535.71%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants13
▷ Global constants538.46%
▷ Class constants861.54%
▷ Public constants450.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin