10% 2046s-widget-loops

Code Review | 2046's Loop widget

WordPress plugin 2046's Loop widget scored10%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: 6.3.1
  • 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

20+ active /10,040 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > 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.37MB] [CPU: ▼48.47ms] Passed 4 tests

This is a short check of server-side resources used by 2046's Loop widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.61 ▼0.846.73 ▼32.87
Dashboard /wp-admin2.63 ▼0.678.11 ▼36.92
Posts /wp-admin/edit.php2.64 ▼0.727.50 ▼39.61
Add New Post /wp-admin/post-new.php2.64 ▼3.256.26 ▼84.49
Media Library /wp-admin/upload.php2.64 ▼0.597.86 ▼26.85
2046's loop widget /wp-admin/options-general.php?page=options_page_slug2.646.65

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_wname_2046_main_loop-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for 2046's Loop widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.23 ▼1.151.74 ▼0.1043.13 ▲2.47
Dashboard /wp-admin2,210 ▲225.77 ▲0.8896.82 ▼17.2741.00 ▼2.60
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0634.48 ▼5.2532.74 ▼2.41
Add New Post /wp-admin/post-new.php1,536 ▲123.10 ▼0.06605.89 ▼45.9758.45 ▼2.00
Media Library /wp-admin/upload.php1,386 ▼24.19 ▼0.0496.13 ▼0.8640.74 ▲0.14
2046's loop widget /wp-admin/options-general.php?page=options_page_slug7972.0225.6724.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or 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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_wname_2046_main_loop-widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > 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+5546
    The called constructor method for WP_Widget class 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+5463
    Function 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+5463
    Function 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (Screenshot of the version 0.241) image required
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt is a good inspiration

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

"2046's Loop widget" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as 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
Success! There were no dangerous files found in this plugin1,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 short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods has to 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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin