84% selected-posts-widget

Code Review | Selected Posts Widget

WordPress plugin Selected Posts Widget scored84%from 54 tests.

About plugin

  • Plugin page: selected-posts-wi...
  • Plugin version: 0.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.4
  • WordPress version: 6.3.1
  • First release: Jul 13, 2016
  • Latest release: Jul 14, 2016
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: campdoug (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,335 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Selected Posts Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.80 ▼1.77
Dashboard /wp-admin3.34 ▲0.0451.14 ▼0.78
Posts /wp-admin/edit.php3.39 ▲0.0449.60 ▼11.54
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.01 ▼25.33
Media Library /wp-admin/upload.php3.26 ▲0.0439.74 ▲2.61

Server storage [IO: ▲0.01MB] [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: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_selected_posts_widget

Browser metrics Passed 4 tests

Selected Posts Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.25 ▼0.911.83 ▲0.1741.40 ▼0.39
Dashboard /wp-admin2,203 ▲155.86 ▲0.95102.27 ▲0.9939.43 ▼3.48
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0235.29 ▼7.9835.61 ▼3.17
Add New Post /wp-admin/post-new.php1,543 ▲2418.47 ▼5.05646.84 ▼31.7057.66 ▲6.71
Media Library /wp-admin/upload.php1,385 ▼04.20 ▲0.02103.75 ▼3.6443.05 ▼5.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_selected_posts_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/selected-posts-widget/widget-template.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/selected-posts-widget/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/selected-posts-widget/selected-posts-widget.php:181

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: No tags were detected
You can look at the official readme.txt

selected-posts-widget/selected-posts-widget.php Passed 13 tests

The primary PHP file in "Selected Posts Widget" version 0.0.2 is used by WordPress to initiate all plugin functionality
35 characters long description:
Show selected posts using a widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin254 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP338125143
JavaScript116076
CSS11035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.50
▷ Minimum class complexity6.00
▷ Maximum class complexity7.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods10
▷ Static methods110.00%
▷ Public methods990.00%
▷ Protected methods110.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/move-arrows.png0.27KB0.20KB▼ 24.91%