10% widget-posts-by-category

Code Review | Posts By Category Widget

WordPress plugin Posts By Category Widget scored 10% from 54 tests.

About plugin

  • Plugin page: widget-posts-by-c...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.8
  • WordPress version: 5.8.1
  • First release: Dec 10, 2013
  • Latest release: Dec 17, 2013
  • Number of updates: 20
  • Update frequency: every 0.4 days
  • Top authors: volfro (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 4,347 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/widget-posts-by-category/catswidget.php+273
    Function create_function() is deprecated

Server metrics [RAM: ▼1.79MB] [CPU: ▼227.48ms] Passed 4 tests

Server-side resources used by Posts By Category Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.84 ▼0.995.43 ▼32.01
Dashboard /wp-admin1.86 ▼1.205.52 ▼44.32
Posts /wp-admin/edit.php1.86 ▼1.266.94 ▼51.19
Add New Post /wp-admin/post-new.php1.86 ▼3.576.22 ▼782.39
Media Library /wp-admin/upload.php1.86 ▼1.145.37 ▼30.96

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

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

Browser metrics Passed 4 tests

Posts By Category Widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲6615.76 ▲0.1610.31 ▼1.4550.14 ▼4.16
Dashboard /wp-admin2,970 ▲365.94 ▼0.36149.31 ▼13.20114.20 ▼2.46
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0072.87 ▲6.3693.22 ▲1.99
Add New Post /wp-admin/post-new.php1,615 ▼021.50 ▲0.57317.24 ▼5.90108.80 ▼5.96
Media Library /wp-admin/upload.php1,810 ▲35.03 ▲0.01162.71 ▼4.36110.92 ▼16.33

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/widget-posts-by-category/catswidget.php+273
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_cats-loop-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/widget-posts-by-category/views/admin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/widget-posts-by-category/views/template.php:2
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/widget-posts-by-category/views/template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-posts-by-category/catswidget.php:13

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: themeable, category, posts, widget

widget-posts-by-category/catswidget.php 85% from 13 tests

This is the main PHP file of "Posts By Category Widget" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("widget-posts-by-category.php" instead of "catswidget.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Success! There were no dangerous files found in this plugin283 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP386117266
PO File10017

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity14.50
▷ Minimum class complexity13.00
▷ Maximum class complexity16.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ 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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin