10% sup-posts-widget

Code Review | Sup Post Widget

WordPress plugin Sup Post Widget scored10%from 54 tests.

About plugin

  • Plugin page: sup-posts-widget
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2013
  • Latest release: May 26, 2015
  • Number of updates: 45
  • Update frequency: every 13.0 days
  • Top authors: usupdotnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,018 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_settings is deprecated since version 2.1.0! Use get_option() instead.

Server metrics [RAM: ▼1.87MB] [CPU: ▼60.41ms] Passed 4 tests

Server-side resources used by Sup Post Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.335.37 ▼40.91
Dashboard /wp-admin2.15 ▼1.196.68 ▼64.38
Posts /wp-admin/edit.php2.15 ▼1.218.10 ▼41.32
Add New Post /wp-admin/post-new.php2.15 ▼3.747.11 ▼95.02
Media Library /wp-admin/upload.php2.15 ▼1.088.60 ▼25.33

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_sup_posts_sidebar_widget
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Sup Post Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲13013.36 ▼1.038.35 ▲6.5544.29 ▲0.34
Dashboard /wp-admin2,196 ▲195.65 ▼0.1994.77 ▼2.9441.37 ▼6.31
Posts /wp-admin/edit.php2,107 ▲42.00 ▼0.0438.27 ▼0.6632.77 ▼1.67
Add New Post /wp-admin/post-new.php1,529 ▲323.17 ▼0.28637.87 ▼50.0652.65 ▼2.52
Media Library /wp-admin/upload.php1,398 ▲14.18 ▼0.0699.06 ▼4.8343.43 ▼2.95
Sup Posts Widgets /wp-admin/spw-settings.php260.420.0914.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_settings is deprecated since version 2.1.0! Use get_option() instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_sup_posts_sidebar_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sup-posts-widget/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sup-posts-widget/spw-settings.php:215
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sup-posts-widget/widget.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/spw-settings.php
    • > Network (severe)
    wp-admin/spw-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Post Widget form in the sidebar), #2 (Post Widget form in the Page/Post)
The official readme.txt is a good inspiration

sup-posts-widget/sup_posts_widget.php 85% from 13 tests

Analyzing the main PHP file in "Sup Post Widget" version 1.8
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sup-posts-widget.php" instead of "sup_posts_widget.php")
  • Description: The description should be shorter than 140 characters (currently 200 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin712 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP37724432
CSS1277244
JavaScript113436

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.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
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
img/nopreview.png3.87KB0.46KB▼ 88.06%