10% recent-posts-from-each-category

Code Review | Recent Posts From Each Category

WordPress plugin Recent Posts From Each Category scored10%from 54 tests.

About plugin

  • Plugin page: recent-posts-from...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: May 8, 2013
  • Latest release: Sep 13, 2014
  • Number of updates: 23
  • Update frequency: every 21.5 days
  • Top authors: mindstien (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /9,520 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
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/recent-posts-from-each-category/classes/sunrise.class.php+76
    Only variables should be passed by reference

Server metrics [RAM: ▼1.86MB] [CPU: ▼58.37ms] Passed 4 tests

Server-side resources used by Recent Posts From Each Category
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.334.75 ▼37.66
Dashboard /wp-admin2.16 ▼1.195.80 ▼59.80
Posts /wp-admin/edit.php2.16 ▼1.206.53 ▼38.05
Add New Post /wp-admin/post-new.php2.16 ▼3.736.30 ▼97.95
Media Library /wp-admin/upload.php2.16 ▼1.075.64 ▼32.60
Recent Posts From Each Category /wp-admin/options-general.php?page=recent-posts-from-each-category2.166.05

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
recent_posts_from_each_category_options
widget_recent-comments

Browser metrics Passed 4 tests

Recent Posts From Each Category: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲15814.05 ▼0.307.55 ▲5.7541.90 ▼1.75
Dashboard /wp-admin2,211 ▲235.84 ▲0.0599.00 ▼16.5339.94 ▼8.03
Posts /wp-admin/edit.php2,094 ▲232.01 ▲0.0036.12 ▲0.2231.59 ▼1.77
Add New Post /wp-admin/post-new.php1,521 ▼1323.51 ▲0.28634.61 ▼32.1153.23 ▼2.27
Media Library /wp-admin/upload.php1,396 ▲54.30 ▲0.0298.03 ▼0.7944.28 ▼1.08
Recent Posts From Each Category /wp-admin/options-general.php?page=recent-posts-from-each-category1,9282.2246.8431.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/recent-posts-from-each-category/classes/sunrise.class.php+76
    Only variables should be passed by reference
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • recent_posts_from_each_category_options
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/classes/sunrise.class.php+76
    Only variables should be passed by reference
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/classes/sunrise.class.php+242
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/notifications.php+33
    Undefined index: message
  • 37 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/html.php+1
    Undefined index: triggable
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/number.php+4
    Undefined index: min
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/number.php+4
    Undefined index: max
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/number.php+4
    Undefined index: units
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/checkbox.php+8
    Undefined index: label
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/select.php+2
    Undefined index: trigger
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=recent-posts-from-each-category
    • > Notice in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/closetab.php+2
    Undefined index: actions

SRP 0% 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
Almost there! Just fix the following items
  • 13× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/checkbox-group.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/opentab.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/hidden.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/color.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/textarea.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/checkbox.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/html.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/radio.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/size.php
    • > /wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/text.php
  • 205× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/number.php on line 4
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/checkbox-group.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/number.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/select.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/size.php on line 4
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/textarea.php on line 5
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/select.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/select.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/html.php on line 3
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/recent-posts-from-each-category/inc/sunrise/views/textarea.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Shortcode Example.), #2 (Preview of plugin output on homepage using above shortcode.)
The official readme.txt might help

recent-posts-from-each-category/recent-posts-from-each-category.php 92% from 13 tests

The main PHP script in "Recent Posts From Each Category" version 1.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 213 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,054 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP241261921,215
JavaScript6148239736
CSS33223103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.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
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
assets/images/success.png0.62KB0.62KB0.00%
screenshot-2.png65.29KB22.41KB▼ 65.68%
assets/images/code.png0.94KB0.10KB▼ 89.75%
screenshot-1.png2.95KB1.06KB▼ 64.04%