73% jm-breaking-news

Code Review | JM Breaking News

WordPress plugin JM Breaking News scored73%from 54 tests.

About plugin

  • Plugin page: jm-breaking-news
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 12, 2015
  • Latest release: Jan 15, 2023
  • Number of updates: 44
  • Update frequency: every 63.0 days
  • Top authors: ArenaPigskin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /21,571 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼12.82ms] Passed 4 tests

This is a short check of server-side resources used by JM Breaking News
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2643.72 ▲5.96
Dashboard /wp-admin3.43 ▲0.1335.04 ▼20.15
Posts /wp-admin/edit.php3.49 ▲0.1439.13 ▼10.99
Add New Post /wp-admin/post-new.php6.08 ▲0.1978.25 ▼22.40
Media Library /wp-admin/upload.php3.43 ▲0.2136.97 ▲2.28
All Breaking News Items /wp-admin/edit.php?post_type=jm_breaking_news3.4838.23
Add New /wp-admin/post-new.php?post_type=jm_breaking_news3.4743.88

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_jm_breaking_news_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

JM Breaking News: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲4514.26 ▼0.091.73 ▲0.0243.88 ▼1.78
Dashboard /wp-admin2,225 ▲455.62 ▲0.0081.63 ▼6.7738.40 ▼7.21
Posts /wp-admin/edit.php2,130 ▲271.95 ▼0.0639.25 ▼1.2240.38 ▲2.69
Add New Post /wp-admin/post-new.php6,395 ▲4,86727.53 ▲4.44915.54 ▲227.5539.15 ▼15.45
Media Library /wp-admin/upload.php1,427 ▲274.21 ▲0.02108.03 ▼4.6545.14 ▲0.36
All Breaking News Items /wp-admin/edit.php?post_type=jm_breaking_news1,1712.2835.4528.53
Add New /wp-admin/post-new.php?post_type=jm_breaking_news2,0373.1882.9934.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_jm_breaking_news_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=jm_breaking_news
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

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
Almost there! Just fix the following items
  • 4× 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/jm-breaking-news/breaking-news-widget.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/jm-breaking-news/public/partials/breaking-news-widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/jm-breaking-news/admin/partials/breaking-news-meta-box.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/jm-breaking-news/blocks/build/breaking-news-block/template.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=jm_breaking_news
    • > Network (severe)
    wp-json/wp/v2/posts?per_page=25 - Failed to load resource: the server responded with a status of 404 (Not Found)

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
2 plugin tags: banner, breaking news

jm-breaking-news/jm-breaking-news.php Passed 13 tests

The main PHP file in "JM Breaking News" ver. 2.1.0 adds more information about the plugin and also serves as the entry point for this plugin
121 characters long description:
Displays a breaking news banner, similar to that of CNN, with custom text and link on the webpage via a custom post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,335 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP17184632997
PO File6240251725
JavaScript92324376
Markdown3310102
Sass12088
JSON10043
CSS4034

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.92
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4284.00%
▷ Protected methods00.00%
▷ Private methods816.00%
Functions5
▷ Named functions5100.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.43MB with 0.31MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png318.13KB87.22KB▼ 72.58%
screenshot-2.png126.95KB39.02KB▼ 69.26%