84% widget-logic

Code Review | Widget Logic

WordPress plugin Widget Logic scored84%from 54 tests.

About plugin

  • Plugin page: widget-logic
  • Plugin version: 5.10.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Feb 28, 2008
  • Latest release: Jul 3, 2019
  • Number of updates: 131
  • Update frequency: every 31.6 days
  • Top authors: alanft (86.26%)wpchefgadget (14.5%)

Code review

54 tests

User reviews

182 reviews

Install metrics

100,000+ active /2,912,152 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
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼13.27ms] Passed 4 tests

This is a short check of server-side resources used by Widget Logic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.85 ▼1.25
Dashboard /wp-admin3.37 ▲0.0353.69 ▼16.89
Posts /wp-admin/edit.php3.43 ▲0.0752.22 ▼13.37
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.55 ▼21.25
Media Library /wp-admin/upload.php3.30 ▲0.0737.38 ▼1.56

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

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

Browser metrics Passed 4 tests

Widget Logic: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.69 ▲0.331.71 ▼0.2739.87 ▼4.31
Dashboard /wp-admin2,195 ▲185.52 ▼0.1286.27 ▼9.6836.44 ▼7.95
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0340.40 ▲0.5636.74 ▼0.07
Add New Post /wp-admin/post-new.php1,526 ▼1123.19 ▲4.72612.80 ▼34.1052.53 ▼12.62
Media Library /wp-admin/upload.php1,403 ▲94.18 ▼0.02102.09 ▼5.3545.12 ▼1.27

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widget-logic/widget_logic.php:16

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 uses markdown syntax to describe your plugin to the world
5 plugin tags: widget, conditional tags, sidebar, toggle, content

widget-logic/widget_logic.php 92% from 13 tests

The main file in "Widget Logic" v. 5.10.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("widget-logic.php" instead of "widget_logic.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
Good job! No executable or dangerous file extensions detected691 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP110134366
PO File5112152325

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions18
▷ Named functions18100.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
PNG images were not found in this plugin