10% wp-news-slider-widgets

Code Review | WP News Slider Widgets

WordPress plugin WP News Slider Widgets scored10%from 54 tests.

About plugin

  • Plugin page: wp-news-slider-wi...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 11, 2016
  • Latest release: Nov 17, 2016
  • Number of updates: 11
  • Update frequency: every 31.8 days
  • Top authors: upscalethought (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /4,630 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-news-slider-widgets/includes/gen-nsw-init.php+44
    Function create_function() is deprecated

Server metrics [RAM: ▼1.73MB] [CPU: ▼52.93ms] Passed 4 tests

Analyzing server-side resources used by WP News Slider Widgets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.26 ▼1.206.10 ▼32.57
Dashboard /wp-admin2.28 ▼1.025.55 ▼45.88
Posts /wp-admin/edit.php2.28 ▼1.087.21 ▼41.69
Add New Post /wp-admin/post-new.php2.28 ▼3.618.89 ▼91.57
Media Library /wp-admin/upload.php2.28 ▼0.957.10 ▼30.67
Pro Version /wp-admin/admin.php?page=pro-version2.286.54
News /wp-admin/admin.php?page=wp-news-slider-widgets/includes/gen-nsw-init.php2.287.06
Add News /wp-admin/admin.php?page=add-news2.287.54

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 23 new files
Database: 1 new table, 7 new options
New tables
wp_gen_news_slider_widgets
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
widget_gen_nsw_widget

Browser metrics Passed 4 tests

WP News Slider Widgets: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲18213.83 ▼0.475.68 ▲3.9641.92 ▼1.19
Dashboard /wp-admin2,231 ▲465.14 ▼0.68100.40 ▼7.4278.32 ▲37.89
Posts /wp-admin/edit.php2,125 ▲362.31 ▲0.2840.49 ▲2.8034.68 ▼3.33
Add New Post /wp-admin/post-new.php1,556 ▲4218.44 ▲0.93633.42 ▲37.0143.09 ▼17.90
Media Library /wp-admin/upload.php1,428 ▲434.31 ▲0.11103.23 ▲1.3671.12 ▲27.47
Pro Version /wp-admin/admin.php?page=pro-version8991.8928.2331.77
News /wp-admin/admin.php?page=wp-news-slider-widgets/includes/gen-nsw-init.php8381.8627.9928.90
Add News /wp-admin/admin.php?page=add-news1,5706.81134.00130.50

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_gen_news_slider_widgets
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_gen_nsw_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > request to
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > request to
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > request to
    • > Deprecated in wp-content/plugins/wp-news-slider-widgets/includes/gen-nsw-init.php+44
    Function create_function() is deprecated
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/admin.php?page=add-news
    • > request to
    • > User notice in wp-includes/functions.php+5905
    Function is_feed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-news
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-news-slider-widgets/includes/gen-news-slider-pro-version.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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:
  • Requires at least: The plugin version is formatted incorrectly
  • Tags: Please delete some tags, you are using 30 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (news slider admin settings), #2 (admin-add news), #3 (widget sample 1), #4 (widget sample 2)
You can look at the official readme.txt

wp-news-slider-widgets/gen-wp-news-slider-widgets.php 92% from 13 tests

The main PHP file in "WP News Slider Widgets" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-news-slider-widgets.php" instead of "gen-wp-news-slider-widgets.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin810 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP56718678
CSS472197
JavaScript242535

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity8.60
▷ Minimum method complexity1.00
▷ Maximum method complexity26.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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.30MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/tick_active.png4.30KB1.51KB▼ 64.87%
images/edit.png3.70KB1.29KB▼ 65.30%
images/bg_blue.png1.12KB1.62KB0.00%
screenshot-3.png124.36KB35.23KB▼ 71.67%
images/tick_inactive.png4.15KB1.36KB▼ 67.18%