10% 2046s-widget-loops

Code Review | 2046's Loop widget

WordPress plugin 2046's Loop widget scored 10% from 54 tests.

About plugin

  • Plugin page: 2046s-widget-loops
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.4.2
  • WordPress version: 5.9.2
  • First release: Feb 6, 2012
  • Latest release: Nov 27, 2012
  • Number of updates: 88
  • Update frequency: every 3.4 days
  • Top authors: o----o (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 9,743 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
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php+32
    Methods with the same name as their class will not be constructors in a future version of PHP; w2046_main_loop has a deprecated constructor

Server metrics [RAM: ▼1.94MB] [CPU: ▼352.98ms] Passed 4 tests

Server-side resources used by 2046's Loop widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.43 ▼1.085.07 ▼44.17
Dashboard /wp-admin2.45 ▼0.965.54 ▼29.00
Posts /wp-admin/edit.php2.45 ▼1.194.55 ▼32.75
Add New Post /wp-admin/post-new.php2.45 ▼4.525.08 ▼1,306.00
Media Library /wp-admin/upload.php2.45 ▼0.854.59 ▼23.95
2046's loop widget /wp-admin/options-general.php?page=options_page_slug2.454.93

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 1 new option
New WordPress options
widget_wname_2046_main_loop-widget

Browser metrics Passed 4 tests

A check of browser resources used by 2046's Loop widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4615.86 ▲0.045.76 ▼0.392.91 ▲0.27
Dashboard /wp-admin2,894 ▲336.09 ▼0.16120.23 ▼15.30156.41 ▼5.13
Posts /wp-admin/edit.php2,693 ▼13.24 ▲0.1964.21 ▼4.32142.25 ▲1.32
Add New Post /wp-admin/post-new.php1,755 ▲9521.50 ▲4.50455.48 ▲46.72155.21 ▼7.98
Media Library /wp-admin/upload.php1,703 ▲55.51 ▼0.00138.66 ▼13.52187.98 ▼4.41
2046's loop widget /wp-admin/options-general.php?page=options_page_slug1,0052.3755.28101.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php+32
    Methods with the same name as their class will not be constructors in a future version of PHP; w2046_main_loop has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_wname_2046_main_loop-widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > Deprecated in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php+32
    Methods with the same name as their class will not be constructors in a future version of PHP; w2046_main_loop has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > User deprecated in wp-includes/functions.php+5409
    The called constructor method for WP_Widget in w2046_main_loop is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > Notice in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php+1415
    Undefined index: w2046_options
    • > GET request to /wp-admin/options-general.php?page=options_page_slug
    • > Notice in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php+1415
    Trying to access array offset on value of type null

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/2046s-widget-loops/2046s_loop_widgets.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Screenshot of the version 0.241) image required
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

2046s-widget-loops/2046s_loop_widgets.php 92% from 13 tests

The entry point to "2046's Loop widget" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("2046s-widget-loops.php" instead of "2046s_loop_widgets.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,955 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP1622281,162
JavaScript2132149463
PO File1124131265
CSS221065

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 129)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity113.00
▷ Minimum class complexity4.00
▷ Maximum class complexity222.00
Average method complexity29.00
▷ Minimum method complexity1.00
▷ Maximum method complexity129.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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