10% category-posts-sidebar-widget

Code Review | Category Posts Sidebar Widget

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

About plugin

  • Plugin page: category-posts-si...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Mar 19, 2015
  • Latest release: Mar 19, 2015
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: junaid15 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 6,781 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
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/category-posts-sidebar-widget/category-posts-sidebar-widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; CategoryPostsSidebarWidget has a deprecated constructor

Server metrics [RAM: ▼2.40MB] [CPU: ▼346.71ms] Passed 4 tests

Analyzing server-side resources used by Category Posts Sidebar Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.97 ▼1.554.21 ▼51.19
Dashboard /wp-admin1.99 ▼1.423.96 ▼64.15
Posts /wp-admin/edit.php1.99 ▼1.655.25 ▼32.88
Add New Post /wp-admin/post-new.php1.99 ▼4.983.98 ▼1,238.61
Media Library /wp-admin/upload.php1.99 ▼1.314.27 ▼20.50

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_categorypostssidebarwidget

Browser metrics Passed 4 tests

A check of browser resources used by Category Posts Sidebar Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲3715.38 ▼0.647.00 ▲0.702.97 ▲0.96
Dashboard /wp-admin2,881 ▲236.07 ▼0.05120.51 ▼17.22161.87 ▼5.32
Posts /wp-admin/edit.php2,694 ▼03.24 ▲0.0064.61 ▲1.51145.14 ▼37.18
Add New Post /wp-admin/post-new.php1,752 ▲9121.54 ▲4.97471.90 ▲25.84156.17 ▼3.82
Media Library /wp-admin/upload.php1,701 ▲65.51 ▲0.00153.79 ▲3.50225.62 ▲13.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/category-posts-sidebar-widget/category-posts-sidebar-widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; CategoryPostsSidebarWidget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_categorypostssidebarwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/category-posts-sidebar-widget/category-posts-sidebar-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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:
  • Tags: There are too many tags (25 tag instead of maximum 10)
  • Requires at least: Version not formatted correctly
  • Screenshots: Add images for these screenshots: #1 (Back end widget settings options - 1a.), #2 (Back end widget settings options - 1b.), #3 (Back end widget settings options - 1c.), #4 (Front end result.)
You can look at the official readme.txt

category-posts-sidebar-widget/category-posts-sidebar-widget.php 92% from 13 tests

The main PHP file in "Category Posts Sidebar Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 254 characters long)

Code Analysis Passed 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 plugin256 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13018256

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png15.49KB4.87KB▼ 68.55%
screenshot-4.png20.50KB8.99KB▼ 56.18%
screenshot-3.png16.52KB6.27KB▼ 62.04%
screenshot-1.png20.21KB6.89KB▼ 65.91%