78% appten-image-rotator

Code Review | Image Rotator

WordPress plugin Image Rotator scored 78% from 54 tests.

About plugin

  • Plugin page: appten-image-rotator
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.6-5.4
  • WordPress version: 6.3.1
  • First release: Aug 11, 2015
  • Latest release: Mar 9, 2020
  • Number of updates: 10
  • Update frequency: every 167.7 days
  • Top authors: appten (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 5,218 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Image Rotator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.76 ▼4.15
Dashboard /wp-admin3.32 ▲0.0149.98 ▲6.14
Posts /wp-admin/edit.php3.37 ▲0.0147.77 ▲3.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.43 ▲7.64
Media Library /wp-admin/upload.php3.24 ▲0.0133.55 ▼1.92
Documentation /wp-admin/admin.php?page=appten_documentation3.2429.88
Image Rotator /wp-admin/admin.php?page=appten_imagerotator3.2329.80

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: 1 new table, 7 new options
New tables
wp_appten_imagerotator
New WordPress options
widget_recent-comments
can_compress_scripts
appten_imagerotator_version
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Rotator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9214.79 ▲0.431.77 ▼0.0841.55 ▼7.00
Dashboard /wp-admin2,233 ▲455.82 ▼0.1097.13 ▲0.6242.47 ▲0.99
Posts /wp-admin/edit.php2,119 ▲302.04 ▼0.0052.01 ▲16.9538.40 ▲7.89
Add New Post /wp-admin/post-new.php1,555 ▲2222.97 ▼0.10608.03 ▼69.5754.85 ▲8.23
Media Library /wp-admin/upload.php1,415 ▲304.15 ▼0.0495.28 ▲0.0244.22 ▲1.19
Documentation /wp-admin/admin.php?page=appten_documentation8382.1821.4928.16
Image Rotator /wp-admin/admin.php?page=appten_imagerotator9282.0623.3124.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=appten_imagerotator
    • > Notice in wp-content/plugins/appten-image-rotator/appten_imagerotator/__default.php+10
    Undefined index: opt
    • > GET request to /wp-admin/admin.php?page=appten_imagerotator
    • > Notice in wp-content/plugins/appten-image-rotator/appten_imagerotator/__grid.php+93
    Undefined variable: category

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
The following issues need your attention
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/appten-image-rotator/appten_imagerotator/__default.php on line 4
    • > PHP Notice
      Undefined index: page in wp-content/plugins/appten-image-rotator/appten_imagerotator/__delete.php on line 6
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/appten-image-rotator/appten_imagerotator/__add.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/appten-image-rotator/appten_imagerotator/__edit.php:22
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/appten-image-rotator/appten_imagerotator/__grid.php on line 3
    • > PHP Notice
      Undefined index: opt in wp-content/plugins/appten-image-rotator/appten_imagerotator/__default.php on line 10
    • > PHP Notice
      Undefined index: edited in wp-content/plugins/appten-image-rotator/appten_imagerotator/__edit.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/appten-image-rotator/appten_imagerotator/__grid.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/appten-image-rotator/config.php:12
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/appten-image-rotator/appten_imagerotator/__grid.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #2 (Adding & Updating Image Rotator Settings) image required
  • Screenshots: Please a description for screenshot #0 in appten-image-rotator/assets to your readme.txt
The official readme.txt is a good inspiration

appten-image-rotator/index.php 92% from 13 tests

This is the main PHP file of "Image Rotator" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("appten-image-rotator.php" instead of "index.php")

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
There were no executable files found in this plugin776 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP128254776

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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