83% sp-news-and-widget

Code Review | WP News and Scrolling Widgets

WordPress plugin WP News and Scrolling Widgets scored83%from 54 tests.

About plugin

  • Plugin page: sp-news-and-widget
  • Plugin version: 4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 16, 2013
  • Latest release: Nov 24, 2023
  • Number of updates: 305
  • Update frequency: every 12.1 days
  • Top authors: anoopranawat (82.3%)wponlinesupport (18.03%)

Code review

54 tests

User reviews

80 reviews

Install metrics

10,000+ active /581,057 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▼4.11ms] Passed 4 tests

A check of server-side resources used by WP News and Scrolling Widgets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4737.68 ▼3.82
Dashboard /wp-admin3.88 ▲0.5351.25 ▼17.80
Posts /wp-admin/edit.php3.94 ▲0.5851.61 ▲0.99
Add New Post /wp-admin/post-new.php6.56 ▲0.67104.11 ▲6.85
Media Library /wp-admin/upload.php3.74 ▲0.5137.47 ▲4.19

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 81 new files
Database: no new tables, 11 new options
New WordPress options
widget_sp_news_widget
widget_recent-posts
wpos_anylc_site_uid
db_upgraded
theysaidso_admin_options
widget_sp_news_s_widget
can_compress_scripts
widget_theysaidso_widget
widget_sp_news_sthumb_widget
widget_recent-comments
...

Browser metrics Passed 4 tests

WP News and Scrolling Widgets: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,544 ▼1,20310.63 ▼4.081.52 ▼0.2717.80 ▼27.52
Dashboard /wp-admin2,221 ▲415.64 ▲0.1097.36 ▲11.6453.19 ▲14.36
Posts /wp-admin/edit.php2,122 ▲192.00 ▲0.0639.92 ▼0.8637.30 ▼5.62
Add New Post /wp-admin/post-new.php6,221 ▲4,68618.95 ▼6.19816.52 ▲163.7558.47 ▼17.37
Media Library /wp-admin/upload.php1,425 ▲254.22 ▲0.0496.78 ▼5.2940.14 ▼3.61

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
  • This plugin does not fully uninstall, leaving 11 options in the database
    • theysaidso_admin_options
    • wpos_anylc_site_uid
    • widget_sp_news_widget
    • wpos_anylc_redirect
    • widget_sp_news_s_widget
    • widget_sp_news_sthumb_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • ...

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)
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/sp-news-and-widget/sp-news-and-widget.php:24

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #7 (Widgets Options)
  • Screenshots: Please describe screenshot #9 in sp-news-and-widget/assets to your readme.txt
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can take inspiration from this readme.txt

sp-news-and-widget/sp-news-and-widget.php Passed 13 tests

"WP News and Scrolling Widgets" version 4.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
116 characters long description:
A simple News and three widgets(static, scrolling and with thumbs) plugin. Also work with Gutenberg shortcode block.

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
Good job! No executable or dangerous file extensions detected6,081 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP337731,2293,564
PO File48089521,845
JavaScript75924412
CSS52711258
JSON2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.82
▷ Minimum class complexity3.00
▷ Maximum class complexity87.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes218.18%
Methods58
▷ Static methods23.45%
▷ Public methods5493.10%
▷ Protected methods00.00%
▷ Private methods46.90%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants19100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
24 PNG files occupy 0.52MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/popup-icon/popup-design.png7.53KB4.51KB▼ 40.14%
assets/images/popup-icon/blog-list-view.png8.12KB2.78KB▼ 65.77%
assets/images/popup-icon/blog-grid.png4.67KB2.53KB▼ 45.73%
assets/images/popup-icon/grid-box.png11.39KB3.31KB▼ 70.95%
assets/images/image-upgrade.png166.27KB48.08KB▼ 71.08%