73% wp-top-news

Code Review | WordPress News Plugin - TopNewsWp

WordPress plugin WordPress News Plugin - TopNewsWp scored 73% from 54 tests.

About plugin

  • Plugin page: wp-top-news
  • Plugin version: 2.3.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 30, 2019
  • Latest release: Jul 8, 2023
  • Number of updates: 106
  • Update frequency: every 13.9 days
  • Top authors: mhmrajib (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active / 18,330 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲5.05MB] [CPU: ▲25.71ms] 50% from 4 tests

Server-side resources used by WordPress News Plugin - TopNewsWp
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,655.64ms on /wp-admin/admin.php?page=wp-top-news)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.05MB on /wp-admin/admin.php?page=wp-top-news)
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4365.87 ▲16.37
Dashboard /wp-admin8.91 ▲5.6179.35 ▲31.27
Posts /wp-admin/edit.php8.91 ▲5.5682.14 ▲35.47
Add New Post /wp-admin/post-new.php9.48 ▲3.60112.85 ▲22.02
Media Library /wp-admin/upload.php8.91 ▲5.6868.25 ▲33.18
Usage & Tutorial /wp-admin/admin.php?page=wtn-get-help8.9152.28
Manage Cache /wp-admin/admin.php?page=wtn-clear-cache8.9153.98
API Settings /wp-admin/admin.php?page=wtn-api-settings8.9151.15
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9161.33
General Settings /wp-admin/admin.php?page=wtn-settings8.9150.78
WP Top News /wp-admin/admin.php?page=wp-top-news8.911,655.64

Server storage [IO: ▲4.41MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 264 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
news_category_children
theysaidso_admin_options
db_upgraded
fs_active_plugins
fs_accounts
fs_debug_mode
default_term_news_category
...

Browser metrics Passed 4 tests

A check of browser resources used by WordPress News Plugin - TopNewsWp
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,008 ▲27313.75 ▼0.654.90 ▲2.7127.05 ▼17.94
Dashboard /wp-admin2,327 ▲1364.98 ▲0.07117.30 ▲2.6245.80 ▲1.87
Posts /wp-admin/edit.php2,209 ▲1172.28 ▲0.2340.84 ▲1.3939.12 ▲2.05
Add New Post /wp-admin/post-new.php1,600 ▲8623.02 ▲5.54677.38 ▼13.4237.83 ▼11.43
Media Library /wp-admin/upload.php1,506 ▲1214.45 ▲0.2896.44 ▼6.1844.91 ▲2.25
Usage & Tutorial /wp-admin/admin.php?page=wtn-get-help280.440.073.91
Manage Cache /wp-admin/admin.php?page=wtn-clear-cache280.440.073.81
API Settings /wp-admin/admin.php?page=wtn-api-settings280.440.084.17
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1731.9728.7027.39
General Settings /wp-admin/admin.php?page=wtn-settings280.440.083.42
WP Top News /wp-admin/admin.php?page=wp-top-news4,4179.81303.69145.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wp-top-news/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 11 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • fs_debug_mode
    • widget_recent-comments
    • fs_accounts
    • news_category_children
    • default_term_news_category
    • db_upgraded
    • widget_theysaidso_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wtn-get-help
    • > Network (severe)
    wp-admin/admin.php?page=wtn-get-help - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wtn-clear-cache
    • > Network (severe)
    wp-admin/admin.php?page=wtn-clear-cache - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wtn-api-settings
    • > Network (severe)
    wp-admin/admin.php?page=wtn-api-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wtn-settings
    • > Network (severe)
    wp-admin/admin.php?page=wtn-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

wp-top-news/wp-top-news.php Passed 13 tests

The main file in "WordPress News Plugin - TopNewsWp" v. 2.3.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
80 characters long description:
TopNewsWp plugin will display news, events, post etc. in your WordPress website.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin36,998 lines of code in 184 files:
LanguageFilesBlank linesComment linesLines of code
PHP1568,29417,30235,659
CSS1816346897
JavaScript74862280
PO File16062148
SVG11013
JSON1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity74.48
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits9
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,320
▷ Static methods19714.92%
▷ Public methods90468.48%
▷ Protected methods392.95%
▷ Private methods37728.56%
Functions105
▷ Named functions10499.05%
▷ Anonymous functions10.95%
Constants153
▷ Global constants10669.28%
▷ Class constants4730.72%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/wp-top-news.png36.32KB10.14KB▼ 72.09%