84% mg-recent-posts

Code Review | mg Recent Posts

WordPress plugin mg Recent Posts scored84%from 54 tests.

About plugin

  • Plugin page: mg-recent-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 16, 2014
  • Latest release: Jul 16, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: giuliom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /616 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by mg Recent Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.90 ▼8.81
Dashboard /wp-admin3.34 ▲0.0444.95 ▼8.44
Posts /wp-admin/edit.php3.39 ▲0.0442.92 ▼3.83
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.16 ▼17.19
Media Library /wp-admin/upload.php3.26 ▲0.0432.00 ▼0.85

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_mg-recent-posts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for mg Recent Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.25 ▼1.144.36 ▲2.6138.55 ▼7.11
Dashboard /wp-admin2,206 ▲185.85 ▲0.95116.67 ▼0.5342.45 ▼4.95
Posts /wp-admin/edit.php2,086 ▼32.03 ▲0.0637.13 ▲1.1132.68 ▲1.46
Add New Post /wp-admin/post-new.php1,535 ▲223.29 ▲0.15627.36 ▼55.8355.00 ▼14.76
Media Library /wp-admin/upload.php1,391 ▼04.18 ▲0.07100.29 ▲1.4240.66 ▼6.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_mg-recent-posts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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)
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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mg-recent-posts/includes/class-mg-widget-recent-posts.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 your attention:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

mg-recent-posts/plugin.php 92% from 13 tests

The main PHP script in "mg Recent Posts" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mg-recent-posts.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin130 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23823130

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.32
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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