10% widgets-on-pages-and-posts

Code Review | Widgets on Pages and Posts

WordPress plugin Widgets on Pages and Posts scored 10% from 54 tests.

About plugin

  • Plugin page: widgets-on-pages-...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.7
  • WordPress version: 5.9.2
  • First release: Nov 20, 2020
  • Latest release: Mar 30, 2021
  • Number of updates: 4
  • Update frequency: every 33.0 days
  • Top authors: mumarym1985 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 287 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/widgets-on-pages-and-posts/includes/class-widgets-on-pages-activator.php+44
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.00MB] [CPU: ▼305.23ms] Passed 4 tests

An overview of server-side resources used by Widgets on Pages and Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3257.42 ▲4.80
Dashboard /wp-admin3.61 ▲0.2026.12 ▼6.87
Posts /wp-admin/edit.php3.67 ▲0.0429.36 ▼10.92
Add New Post /wp-admin/post-new.php6.41 ▼0.5679.35 ▼1,203.48
Media Library /wp-admin/upload.php3.62 ▲0.3222.44 ▲0.35
Widgets /wp-admin/widgets.php5.3847.55
Menus /wp-admin/nav-menus.php4.1337.67
Turbo Sidebars /wp-admin/edit.php?post_type=turbo-sidebar-cpt3.6627.74

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

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • There were 1 file (13.56KB) illegally modified outside of "wp-content/plugins/widgets-on-pages-and-posts/" and "wp-content/uploads/"
    • (new file) siteguarding_tools.php
Filesystem: 161 new files
Database: no new tables, 5 new options
New WordPress options
fs_debug_mode
fs_accounts
fs_api_cache
wop_plugin_version
fs_active_plugins

Browser metrics Passed 4 tests

This is an overview of browser requirements for Widgets on Pages and Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,853 ▲9915.89 ▲0.256.62 ▼0.012.64 ▼0.28
Dashboard /wp-admin2,953 ▲996.21 ▼0.07121.24 ▼12.59174.03 ▲16.89
Posts /wp-admin/edit.php2,745 ▲513.28 ▲0.0568.41 ▲4.56150.78 ▲9.82
Add New Post /wp-admin/post-new.php1,708 ▲4718.43 ▲2.00405.62 ▼19.00160.62 ▲3.55
Media Library /wp-admin/upload.php1,755 ▲575.58 ▲0.04143.32 ▼1.15202.16 ▲12.73
Widgets /wp-admin/widgets.php2,53024.20539.76132.71
Menus /wp-admin/nav-menus.php2,3013.3784.49139.81
Turbo Sidebars /wp-admin/edit.php?post_type=turbo-sidebar-cpt2,1153.2564.48152.89

Uninstaller [IO: ▲0.01MB] [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
These items require your attention
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_api_cache
    • fs_active_plugins
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=turbo-sidebar-cpt
    • > User deprecated in wp-includes/functions.php+5691
    contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/widgets-on-pages-and-posts/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-and-posts/includes/class-functions.php:85

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 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

widgets-on-pages-and-posts/widgets_on_pages.php 85% from 13 tests

The primary PHP file in "Widgets on Pages and Posts" version 1.4.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("widgets-on-pages-and-posts.php" instead of "widgets_on_pages.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin23,067 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP883,6899,38715,904
PO File51,8741,8974,811
Sass16277821,713
JavaScript64562376
Markdown1640189
CSS136442
JSON10032

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,042)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity39.44
▷ Minimum class complexity1.00
▷ Maximum class complexity1,042.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes43
▷ Abstract classes24.65%
▷ Concrete classes4195.35%
▷ Final classes00.00%
Methods720
▷ Static methods11215.56%
▷ Public methods53974.86%
▷ Protected methods121.67%
▷ Private methods16923.47%
Functions81
▷ Named functions81100.00%
▷ Anonymous functions00.00%
Constants97
▷ Global constants8082.47%
▷ Class constants1717.53%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/widgets-on-pages.png9.16KB5.26KB▼ 42.58%