84% page-for-random-banners

Code Review | Page for Random Banners

WordPress plugin Page for Random Banners scored 84% from 54 tests.

About plugin

  • Plugin page: page-for-random-b...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 24, 2016
  • Latest release: Aug 29, 2023
  • Number of updates: 140
  • Update frequency: every 19.4 days
  • Top authors: rainbowlinkinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,929 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.02MB] [CPU: ▼4.02ms] Passed 4 tests

Analyzing server-side resources used by Page for Random Banners
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.20 ▼0.45
Dashboard /wp-admin3.33 ▲0.0246.96 ▲1.27
Posts /wp-admin/edit.php3.38 ▲0.0243.99 ▼2.49
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.21 ▼14.40
Media Library /wp-admin/upload.php3.25 ▲0.0235.08 ▲4.72
Page for Random Banners /wp-admin/edit.php?post_type=rl_pfrb_headerfooter3.2933.25
Add a New Page for Random Banners /wp-admin/post-new.php?post_type=rl_pfrb_headerfooter3.3946.42

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Page for Random Banners
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.59 ▼0.955.83 ▲4.0144.69 ▼0.51
Dashboard /wp-admin2,236 ▲454.82 ▼1.0793.38 ▼8.0535.29 ▼7.13
Posts /wp-admin/edit.php2,116 ▲272.02 ▲0.0235.48 ▼5.6134.32 ▼0.50
Add New Post /wp-admin/post-new.php1,556 ▲2723.13 ▲4.87648.54 ▲25.5758.09 ▲10.00
Media Library /wp-admin/upload.php1,415 ▲304.20 ▲0.0393.25 ▼3.7741.76 ▼0.91
Page for Random Banners /wp-admin/edit.php?post_type=rl_pfrb_headerfooter1,0861.9330.0228.07
Add a New Page for Random Banners /wp-admin/post-new.php?post_type=rl_pfrb_headerfooter2,2057.59167.5261.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/page-for-random-banners/page-for-random-banners.php:55

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed: Please take inspiration from this readme.txt

page-for-random-banners/page-for-random-banners.php Passed 13 tests

The primary PHP file in "Page for Random Banners" version 1.3.1 is used by WordPress to initiate all plugin functionality
59 characters long description:
You can add (a) page(s) which display(s) banners at random.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected116 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP41796104
CSS243612

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 1.62MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
example/images/b6.png0.12KB0.08KB▼ 31.45%
example/images/b3.png0.12KB0.08KB▼ 31.45%
example/images/b7.png0.12KB0.08KB▼ 30.33%
example/images/b4.png0.12KB0.08KB▼ 31.45%
example/images/b2.png0.12KB0.08KB▼ 31.45%