84% gp-random-post-widget

Code Review | GP Random Post Widget

WordPress plugin GP Random Post Widget scored84%from 54 tests.

About plugin

  • Plugin page: gp-random-post-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-1.0
  • WordPress version: 6.3.1
  • First release: Nov 2, 2015
  • Latest release: Nov 2, 2015
  • Number of updates: 5
  • Update frequency: every 21.4 days
  • Top authors: giangmd93 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /955 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.25ms] Passed 4 tests

Server-side resources used by GP Random Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.79 ▼5.48
Dashboard /wp-admin3.31 ▲0.0146.24 ▼0.53
Posts /wp-admin/edit.php3.36 ▲0.0152.82 ▲3.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.81 ▲1.35
Media Library /wp-admin/upload.php3.24 ▲0.0135.92 ▼0.35

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

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

Browser metrics Passed 4 tests

A check of browser resources used by GP Random Post Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.66 ▼0.991.61 ▼0.6141.13 ▼6.52
Dashboard /wp-admin2,206 ▲184.86 ▼0.05105.95 ▼15.3340.23 ▼2.21
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0339.81 ▲2.4835.92 ▼0.70
Add New Post /wp-admin/post-new.php1,548 ▲1523.73 ▲0.32639.55 ▼59.3152.64 ▼17.93
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.02102.64 ▲4.3342.65 ▼2.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_gp_random_post
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gp-random-post-widget/gp-random-post-widget.php:13

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 97% 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: You can look at the official readme.txt

gp-random-post-widget/gp-random-post-widget.php Passed 13 tests

"GP Random Post Widget" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
26 characters long description:
Create Random Post Widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin49 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111149

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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
There are no PNG files in this plugin