84% custom-news-widget

Code Review | Custom News Widget

WordPress plugin Custom News Widget scored84%from 54 tests.

About plugin

  • Plugin page: custom-news-widget
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 24, 2018
  • Latest release: Mar 24, 2018
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: sujitkumar87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,369 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼0.96ms] Passed 4 tests

An overview of server-side resources used by Custom News Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1046.89 ▲2.76
Dashboard /wp-admin3.40 ▲0.1056.95 ▲1.63
Posts /wp-admin/edit.php3.50 ▲0.1454.60 ▲3.64
Add New Post /wp-admin/post-new.php5.99 ▲0.0989.60 ▼11.89
Media Library /wp-admin/upload.php3.33 ▲0.0941.09 ▲4.29
Add New /wp-admin/post-new.php?post_type=news3.4859.83
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=news3.3244.69
All News /wp-admin/edit.php?post_type=news3.3646.41
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=news3.3244.74

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 8 new options
New WordPress options
widget_news_widget
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
category_children

Browser metrics Passed 4 tests

An overview of browser requirements for Custom News Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.32 ▼0.241.72 ▲0.1043.11 ▲3.34
Dashboard /wp-admin2,230 ▲535.58 ▲0.0485.55 ▼7.8341.95 ▼3.43
Posts /wp-admin/edit.php2,135 ▲322.02 ▲0.0835.50 ▼3.3437.45 ▲0.90
Add New Post /wp-admin/post-new.php1,557 ▲2923.41 ▲0.03675.51 ▲44.2555.14 ▲1.06
Media Library /wp-admin/upload.php1,435 ▲354.27 ▲0.11101.79 ▲1.5441.36 ▼3.42
Add New /wp-admin/post-new.php?post_type=news2,7177.90177.3365.65
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=news1,3572.1226.5931.16
All News /wp-admin/edit.php?post_type=news1,1961.9636.4234.17
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=news1,4872.1228.0735.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_news_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • category_children

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-news-widget/includes/class-cnw-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-news-widget/includes/class-cnw-cpt.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: wordpress news plugin, news website, news widget, news, news plugin

custom-news-widget/custom-news-widget.php Passed 13 tests

The principal PHP file in "Custom News Widget" v. 1.0 is loaded by WordPress automatically on each request
32 characters long description:
News Widget Plugin for WordPress

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
Everything looks great! No dangerous files found in this plugin137 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32464137

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.PNG57.73KB28.27KB▼ 51.03%
screenshot-1.PNG35.45KB18.81KB▼ 46.92%