10% news-bar

Code Review | News Bar Plus

WordPress plugin News Bar Plus scored 10% from 54 tests.

About plugin

  • Plugin page: news-bar
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Apr 10, 2012
  • Latest release: May 26, 2012
  • Number of updates: 8
  • Update frequency: every 6.8 days
  • Top authors: gn_themes (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 8,903 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; GN_Plugin_Framework has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼51.75ms] Passed 4 tests

An overview of server-side resources used by News Bar Plus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.354.37 ▼38.14
Dashboard /wp-admin2.13 ▼1.187.45 ▼40.34
Posts /wp-admin/edit.php2.13 ▼1.236.85 ▼40.44
Add New Post /wp-admin/post-new.php2.13 ▼3.767.51 ▼88.08
Media Library /wp-admin/upload.php2.13 ▼1.107.77 ▼22.57
News Bar /wp-admin/options-general.php?page=news-bar2.137.42
Add item /wp-admin/post-new.php?post_type=news-bar-plus2.135.75
News Bar /wp-admin/edit.php?post_type=news-bar-plus2.137.52

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 122 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
news_bar_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by News Bar Plus
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,766 ▲3113.64 ▼0.655.73 ▲3.6337.63 ▼7.81
Dashboard /wp-admin2,239 ▲515.79 ▲0.91110.95 ▲2.9674.95 ▲27.98
Posts /wp-admin/edit.php2,125 ▲362.02 ▲0.0338.47 ▼2.9036.07 ▼2.57
Add New Post /wp-admin/post-new.php1,702 ▲18824.22 ▲6.67653.98 ▲44.7051.65 ▲0.48
Media Library /wp-admin/upload.php1,409 ▲244.21 ▲0.0397.93 ▼5.1970.66 ▲29.73
News Bar /wp-admin/options-general.php?page=news-bar2,1541.9580.3633.54
Add item /wp-admin/post-new.php?post_type=news-bar-plus2,1547.59186.63122.98
News Bar /wp-admin/edit.php?post_type=news-bar-plus1,0861.9632.5331.38

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 cannot be uninstalled
    • > Deprecated in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; GN_Plugin_Framework has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • news_bar_options
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=news-bar-plus
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; GN_Plugin_Framework has a deprecated constructor
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=news-bar-plus
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+214
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Notice in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+316
    Undefined index: reseted
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Notice in wp-content/plugins/news-bar/classes/gn-plugin-framework.class.php+334
    Undefined index: saved
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Notice in wp-content/plugins/news-bar/includes/fields/select.php+3
    Undefined index: triggable
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Notice in wp-content/plugins/news-bar/includes/fields/select.php+2
    Undefined index: trigger

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/news-bar/includes/fields/opentab.php
    • > /wp-content/plugins/news-bar/includes/fields/checkbox.php
    • > /wp-content/plugins/news-bar/includes/fields/color.php
    • > /wp-content/plugins/news-bar/includes/fields/hidden.php
    • > /wp-content/plugins/news-bar/includes/fields/size.php
    • > /wp-content/plugins/news-bar/includes/fields/number.php
    • > /wp-content/plugins/news-bar/includes/fields/select.php
    • > /wp-content/plugins/news-bar/includes/fields/title.php
    • > /wp-content/plugins/news-bar/includes/fields/radio.php
    • > /wp-content/plugins/news-bar/includes/fields/text.php
  • 208× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/news-bar/includes/fields/select.php on line 3
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/news-bar/includes/fields/icon.php on line 6
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/news-bar/includes/fields/radio.php on line 6
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/news-bar/includes/fields/select.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/news-bar/includes/fields/social-icon.php on line 6
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/news-bar/includes/fields/social-icon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/news-bar/includes/fields/radio.php on line 9
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/news-bar/includes/fields/number.php on line 5
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/news-bar/includes/fields/size.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/news-bar/includes/fields/number.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,farbtastic,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).css(...).live is not a function" "TypeError: $(...).css(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/news-bar/assets/js/backend.js?ver=2.0.0:71:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,farbtastic,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,farbtastic,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=news-bar
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,farbtastic,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).css(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

news-bar/news-bar.php Passed 13 tests

"News Bar Plus" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
84 characters long description:
News bar with latest tweets or posts from specified blog category. Extended version.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected3,047 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP24186241974
JavaScript7203354964
CSS146841728
PO File1148181285
HTML112495
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
68 PNG files occupy 0.26MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/twitter-4.png0.40KB0.48KB0.00%
assets/images/post-type.png0.46KB0.34KB▼ 25.53%
assets/skins/images/wood.png26.79KB14.51KB▼ 45.85%
assets/images/icons/wordpress.png0.82KB0.80KB▼ 1.91%
documentation/css/img/warning.png0.59KB0.50KB▼ 14.99%