78% widget-2x2forum

Code Review | widget-2x2forum

WordPress plugin widget-2x2forum scored78%from 54 tests.

About plugin

  • Plugin page: widget-2x2forum
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 21, 2022
  • Latest release: Jun 21, 2022
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: stesha66 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /268 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.10ms] Passed 4 tests

Server-side resources used by widget-2x2forum
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.15 ▼3.64
Dashboard /wp-admin3.34 ▲0.0455.49 ▲6.46
Posts /wp-admin/edit.php3.39 ▲0.0445.63 ▼2.68
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.26 ▼9.93
Media Library /wp-admin/upload.php3.27 ▲0.0434.19 ▼0.16

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_2x2forum_widget
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for widget-2x2forum
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.27 ▲0.041.80 ▲0.0044.00 ▼1.55
Dashboard /wp-admin2,195 ▲155.61 ▼0.0695.89 ▲3.3942.40 ▼10.66
Posts /wp-admin/edit.php2,103 ▲32.16 ▲0.1835.92 ▼0.0329.80 ▼3.90
Add New Post /wp-admin/post-new.php1,535 ▲918.51 ▼4.94623.33 ▲4.2668.09 ▲14.76
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.0994.60 ▼1.6241.24 ▼1.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_2x2forum_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/widget-2x2forum/bootstrap.php
    • > /wp-content/plugins/widget-2x2forum/views/threads.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: async in wp-content/plugins/widget-2x2forum/views/threads.php on line 4
    • > PHP Warning
      Use of undefined constant WP_FORUM_2x2_REQUIRED_WP_VERSION - assumed 'WP_FORUM_2x2_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-2x2forum/views/requirements-error.php on line 11
    • > PHP Warning
      Use of undefined constant WP_FORUM_2x2_REQUIRED_PHP_VERSION - assumed 'WP_FORUM_2x2_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-2x2forum/views/requirements-error.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/widget-2x2forum/views/requirements-error.php:12
    • > PHP Warning
      Use of undefined constant WP_FORUM_2x2_NAME - assumed 'WP_FORUM_2x2_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-2x2forum/views/requirements-error.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-2x2forum/classes/wp_2x2forum-instance.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: The official readme.txt might help

widget-2x2forum/bootstrap.php 92% from 13 tests

The entry point to "widget-2x2forum" version 1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("widget-2x2forum.php" instead of "bootstrap.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
No dangerous file extensions were detected267 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP44023182
JavaScript171448
CSS15027
SVG20010

PHP code Passed 2 tests

A short review of 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.29
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin