10% recent-post-widget-by-category

Code Review | Plugin Name: Recent Post Widget By Category

WordPress plugin Plugin Name: Recent Post Widget By Category scored10%from 54 tests.

About plugin

  • Plugin page: recent-post-widge...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.6
  • WordPress version: 6.3.1
  • First release: Sep 10, 2013
  • Latest release: Sep 10, 2013
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: rameshwor.maharjan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /750 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; RPF has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼58.46ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Name: Recent Post Widget By Category
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.51 ▼35.82
Dashboard /wp-admin2.10 ▼1.245.98 ▼56.02
Posts /wp-admin/edit.php2.10 ▼1.256.14 ▼40.13
Add New Post /wp-admin/post-new.php2.10 ▼3.785.42 ▼101.85
Media Library /wp-admin/upload.php2.10 ▼1.125.40 ▼26.26
Link Page & Post /wp-admin/admin.php?page=link-page-post2.105.92

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: 1 new table, 8 new options
New tables
wp_post_page_link
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
recovery_mode_email_last_sent
RPF_db_version
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Plugin Name: Recent Post Widget By Category
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.20 ▼1.081.82 ▼0.1538.02 ▼7.71
Dashboard /wp-admin2,226 ▲414.85 ▼1.00109.78 ▲6.6639.31 ▼4.40
Posts /wp-admin/edit.php2,112 ▲232.05 ▲0.0239.27 ▲3.3734.32 ▼1.12
Add New Post /wp-admin/post-new.php1,552 ▲3323.12 ▼0.15656.57 ▲0.9147.41 ▼7.08
Media Library /wp-admin/upload.php1,414 ▲264.25 ▼0.0195.34 ▼12.0244.42 ▼1.47
Link Page & Post /wp-admin/admin.php?page=link-page-post6971.536.7316.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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/recent-post-widget-by-category/recent-post-flexible.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; RPF has a deprecated constructor
  • Zombie tables detected upon uninstall: 1 table
    • wp_post_page_link
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • RPF_db_version
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=link-page-post
    • > Deprecated in wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; RPF has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=link-page-post
    • > User deprecated in wp-includes/functions.php+5453
    Function register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=link-page-post
    • > User deprecated in wp-includes/functions.php+5453
    Function register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=link-page-post
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/admin.php?page=link-page-post
    • > Error in wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php+238
    Uncaught Error: [] operator not supported for strings in wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php:238
    Stack trace:
    #0 wp-content/plugins/recent-post-widget-by-category/link-page-post.php(25): RPF->get_post_tree()
    #1 wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php(220): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): RPF->admin_router()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/recent-post-widget-by-category/rpf-widget-control.php
    • > /wp-content/plugins/recent-post-widget-by-category/related-widget-control.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: rpf_title in wp-content/plugins/recent-post-widget-by-category/rpf-widget-control.php on line 4
    • > PHP Notice
      Undefined variable: rpf_post_number in wp-content/plugins/recent-post-widget-by-category/rpf-widget.php on line 6
    • > PHP Notice
      Undefined variable: rpf_post_number in wp-content/plugins/recent-post-widget-by-category/rpf-widget-control.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_post_tree() on null in wp-content/plugins/recent-post-widget-by-category/link-page-post.php:23
    • > PHP Notice
      Undefined variable: rpf_category_id in wp-content/plugins/recent-post-widget-by-category/rpf-widget.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/recent-post-widget-by-category/rpf-widget.php:10
    • > PHP Notice
      Undefined variable: related_post_number in wp-content/plugins/recent-post-widget-by-category/related-widget-control.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/recent-post-widget-by-category/recent-post-flexible.php:30
    • > PHP Notice
      Undefined variable: rpf_title in wp-content/plugins/recent-post-widget-by-category/rpf-widget.php on line 2
    • > PHP Notice
      Undefined variable: related_title in wp-content/plugins/recent-post-widget-by-category/related-widget.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Recent Post Widget By Category === )
You can take inspiration from this readme.txt

recent-post-widget-by-category/recent-post-flexible.php 92% from 13 tests

The primary PHP file in "Plugin Name: Recent Post Widget By Category" version 0.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("recent-post-widget-by-category.php" instead of "recent-post-flexible.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin363 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP615127363

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin