84% magic-widgets

Code Review | Magic Widgets

WordPress plugin Magic Widgets scored84%from 54 tests.

About plugin

  • Plugin page: magic-widgets
  • Plugin version: 2014.01.22
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Jan 15, 2011
  • Latest release: Mar 23, 2014
  • Number of updates: 20
  • Update frequency: every 58.2 days
  • Top authors: toscho (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /6,092 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.83ms] Passed 4 tests

This is a short check of server-side resources used by Magic Widgets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.29 ▲4.18
Dashboard /wp-admin3.35 ▲0.0553.82 ▼0.04
Posts /wp-admin/edit.php3.46 ▲0.1149.36 ▼0.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0587.43 ▼3.77
Media Library /wp-admin/upload.php3.27 ▲0.0438.70 ▲1.19

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_unfiltered_text

Browser metrics Passed 4 tests

This is an overview of browser requirements for Magic Widgets
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.081.81 ▲0.1144.70 ▲0.93
Dashboard /wp-admin2,195 ▲285.65 ▲0.0786.24 ▼16.1440.45 ▼3.73
Posts /wp-admin/edit.php2,097 ▼32.01 ▲0.0137.50 ▼0.7933.02 ▼2.69
Add New Post /wp-admin/post-new.php1,526 ▼1123.16 ▲4.90689.41 ▲22.4759.36 ▼13.09
Media Library /wp-admin/upload.php1,403 ▲34.10 ▼0.07111.23 ▲12.5947.92 ▼1.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_unfiltered_text
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • 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 no errors were found, this is by no means 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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magic-widgets/class.Unfiltered_Text_Widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-widgets/toschos-magic-widgets.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: widget, sidebar, admin

magic-widgets/toschos-magic-widgets.php 92% from 13 tests

The primary PHP file in "Magic Widgets" version 2014.01.22 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("magic-widgets.php" instead of "toschos-magic-widgets.php")

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 detected237 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP243130192
PO File1132445

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.50
▷ Minimum class complexity5.00
▷ Maximum class complexity10.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1066.67%
▷ Protected methods533.33%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin