83% mmfilesi-random-post

Code Review | mmfilesi-random-post

WordPress plugin mmfilesi-random-post scored83%from 54 tests.

About plugin

  • Plugin page: mmfilesi-random-post
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 7, 2012
  • Latest release: Nov 7, 2012
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: mmfilesi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,180 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by mmfilesi-random-post
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0443.53 ▲6.68
Dashboard /wp-admin3.35 ▲0.0443.57 ▼5.47
Posts /wp-admin/edit.php3.40 ▲0.0444.57 ▼7.74
Add New Post /wp-admin/post-new.php5.93 ▲0.0499.79 ▲14.62
Media Library /wp-admin/upload.php3.27 ▲0.0436.23 ▲4.80

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_mmfilesi_random_post_widget

Browser metrics Passed 4 tests

A check of browser resources used by mmfilesi-random-post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13713.59 ▼0.678.63 ▲7.0439.83 ▼1.06
Dashboard /wp-admin2,206 ▲184.87 ▼1.01109.38 ▲6.6346.06 ▲6.64
Posts /wp-admin/edit.php2,089 ▼32.03 ▼0.0135.13 ▼1.0934.72 ▲2.12
Add New Post /wp-admin/post-new.php1,542 ▲2323.26 ▲0.03610.65 ▼46.8757.49 ▲9.76
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.0198.52 ▼2.9743.12 ▲1.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_mmfilesi_random_post_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mmfilesi-random-post/mmfilesi-random-post.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% 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 to be fixed:
  • Requires at least: Invalid plugin version format
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Back-end.), #2 (Front-end)
  • Plugin Name: Please specify the plugin name on the first line ( === mmfilesi-random-post === )
You can look at the official readme.txt

mmfilesi-random-post/mmfilesi-random-post.php Passed 13 tests

"mmfilesi-random-post" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
18 characters long description:
select random post

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
No dangerous file extensions were detected226 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16429168
CSS17045
JavaScript12013

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/picture_default.png3.12KB2.50KB▼ 19.76%
screenshot-2.png73.92KB23.28KB▼ 68.51%
screenshot-1.png9.23KB5.06KB▼ 45.18%