10% widgets-on-pages

Code Review | Widgets on Pages

WordPress plugin Widgets on Pages scored10%from 54 tests.

About plugin

  • Plugin page: widgets-on-pages
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 20, 2010
  • Latest release: Jul 11, 2023
  • Number of updates: 120
  • Update frequency: every 40.3 days
  • Top authors: toddhalfpenny (100%)

Code review

54 tests

User reviews

155 reviews

Install metrics

30,000+ active /618,446 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/widgets-on-pages/includes/class-widgets-on-pages-activator.php+44
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲5.39MB] [CPU: ▲27.33ms] 75% from 4 tests

A check of server-side resources used by Widgets on Pages
It is recommended to improve the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.39MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7566.93 ▲25.48
Dashboard /wp-admin9.24 ▲5.8978.55 ▲14.03
Posts /wp-admin/edit.php9.24 ▲5.8883.88 ▲36.80
Add New Post /wp-admin/post-new.php9.94 ▲4.05133.20 ▲39.21
Media Library /wp-admin/upload.php9.24 ▲6.0167.72 ▲33.02
Turbo Sidebars /wp-admin/edit.php?post_type=turbo-sidebar-cpt9.2466.23
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2461.95

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 204 new files
Database: no new tables, 10 new options
New WordPress options
fs_accounts
theysaidso_admin_options
fs_active_plugins
wop_plugin_version
fs_debug_mode
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Widgets on Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.60 ▼1.081.82 ▲0.0129.88 ▼13.89
Dashboard /wp-admin2,243 ▲615.00 ▼0.86120.24 ▲14.5944.71 ▲3.07
Posts /wp-admin/edit.php2,129 ▲402.18 ▲0.1745.00 ▲9.3938.40 ▲2.85
Add New Post /wp-admin/post-new.php1,537 ▲422.78 ▼0.20703.00 ▲90.0567.99 ▲20.19
Media Library /wp-admin/upload.php1,422 ▲374.26 ▲0.00106.29 ▼5.5445.37 ▼0.13
Turbo Sidebars /wp-admin/edit.php?post_type=turbo-sidebar-cpt1,6222.0644.2534.40
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0831.8523.7327.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/widgets-on-pages/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_accounts
    • fs_active_plugins
    • db_upgraded
    • can_compress_scripts
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/widgets-on-pages/admin/partials/widgets-on-pages-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widgets-on-pages/includes/class-functions.php:85

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add images for these screenshots: #1 (Setting up the sidebars.), #2 (Widgets on Pages 'Turbo Sidebars' page.)
Please take inspiration from this readme.txt

widgets-on-pages/widgets_on_pages.php 92% from 13 tests

The main PHP script in "Widgets on Pages" version 1.8.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("widgets-on-pages.php" instead of "widgets_on_pages.php")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin35,038 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP1308,14217,99334,379
JavaScript64562376
Markdown1680214
CSS166442
JSON10027

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.24
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods1,305
▷ Static methods20315.56%
▷ Public methods91169.81%
▷ Protected methods171.30%
▷ Private methods37728.89%
Functions106
▷ Named functions106100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png65.08KB24.61KB▼ 62.18%
screenshot-1.png14.76KB7.80KB▼ 47.11%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%