84% rotating-ad

Code Review | Rotating Ad Plugin

WordPress plugin Rotating Ad Plugin scored84%from 54 tests.

About plugin

  • Plugin page: rotating-ad
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 14, 2013
  • Latest release: Nov 14, 2013
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: jprobst21 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /2,532 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Server-side resources used by Rotating Ad Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.82 ▼3.61
Dashboard /wp-admin3.31 ▲0.0147.50 ▼4.96
Posts /wp-admin/edit.php3.36 ▲0.0153.08 ▲2.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.83 ▼4.45
Media Library /wp-admin/upload.php3.23 ▲0.0138.88 ▼0.19

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/rotating-ad/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Rotating Ad Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.21 ▼1.071.68 ▼0.2641.51 ▼3.68
Dashboard /wp-admin2,221 ▲185.83 ▲0.75109.48 ▼6.0542.52 ▼3.69
Posts /wp-admin/edit.php2,100 ▼02.05 ▲0.0141.49 ▲3.6737.88 ▲6.20
Add New Post /wp-admin/post-new.php1,545 ▲1423.16 ▼0.05623.31 ▼69.8460.18 ▲8.34
Media Library /wp-admin/upload.php1,403 ▲34.24 ▲0.1098.33 ▼13.1842.14 ▼6.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/rotating-ad/rotating-ad-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/rotating-ad/lib/wp-init.php on line 25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rotating-ad/lib/rotating-ad-widget.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/rotating-ad/rotating-ad.php:30
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/rotating-ad/lib/wp-init.php on line 25
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/rotating-ad/rotating-ad-install.php): failed to open stream: No such file or directory in wp-content/plugins/rotating-ad/lib/wp-init.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: ad, rotating ad

rotating-ad/rotating-ad-install.php 92% from 13 tests

This is the main PHP file of "Rotating Ad Plugin" version 0.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("rotating-ad.php" instead of "rotating-ad-install.php")

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
No dangerous file extensions were detected418 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4103114332
CSS116252
JavaScript215534

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
There are no PNG files in this plugin