84% mj-news

Code Review | MJ news plugin

WordPress plugin MJ news plugin scored84%from 54 tests.

About plugin

  • Plugin page: mj-news
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 6.3.1
  • First release: Nov 27, 2012
  • Latest release: Jan 4, 2013
  • Number of updates: 6
  • Update frequency: every 6.5 days
  • Top authors: anildhiman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /4,023 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.28ms] Passed 4 tests

This is a short check of server-side resources used by MJ news plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.72 ▲4.01
Dashboard /wp-admin3.33 ▲0.0350.36 ▼3.16
Posts /wp-admin/edit.php3.38 ▲0.0350.74 ▼2.05
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.81 ▼23.93
Media Library /wp-admin/upload.php3.26 ▲0.0338.75 ▲4.26
News /wp-admin/edit.php?post_type=news3.3039.92
Add News /wp-admin/post-new.php?post_type=news3.4154.75
News category /wp-admin/edit-tags.php?taxonomy=news&post_type=news3.2538.23

Server storage [IO: ▲0.09MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for MJ news plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8914.19 ▼0.431.88 ▲0.2346.90 ▲3.32
Dashboard /wp-admin2,229 ▲525.64 ▼0.0194.04 ▲7.7641.50 ▼3.71
Posts /wp-admin/edit.php2,131 ▲312.01 ▲0.0435.41 ▼6.6733.31 ▼5.85
Add New Post /wp-admin/post-new.php1,557 ▲3023.33 ▲0.36666.65 ▼9.1850.55 ▼7.98
Media Library /wp-admin/upload.php1,431 ▲284.19 ▼0.0496.02 ▼4.1841.02 ▼5.11
News /wp-admin/edit.php?post_type=news1,1431.9732.9732.50
Add News /wp-admin/post-new.php?post_type=news2,8247.82181.9478.87
News category /wp-admin/edit-tags.php?taxonomy=news&post_type=news1,3052.1227.5130.64

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mj-news/index.php:13

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: news plugin, news section, category news section, latest news

mj-news/index.php 85% from 13 tests

The primary PHP file in "MJ news plugin" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 300 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mj-news.php" instead of "index.php")

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
There were no executable files found in this plugin167 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS119484
PHP1201083

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
15 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_gloss-wave_100_ece8da_500x100.png2.08KB1.31KB▼ 37.18%
css/images/ui-bg_highlight-soft_25_67b021_1x100.png0.12KB0.18KB0.00%
css/images/ui-bg_inset-soft_15_2b2922_1x100.png0.12KB0.18KB0.00%
css/images/ui-bg_highlight-hard_15_459e00_1x100.png0.15KB0.15KB▼ 1.96%
css/images/ui-icons_ffffff_256x240.png4.27KB4.11KB▼ 3.78%