84% best-host-news

Code Review | Besthostnews

WordPress plugin Besthostnews scored84%from 54 tests.

About plugin

  • Plugin page: best-host-news
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Sep 15, 2013
  • Latest release: Dec 12, 2016
  • Number of updates: 21
  • Update frequency: every 56.4 days
  • Top authors: besthostnews (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,052 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.95ms] Passed 4 tests

A check of server-side resources used by Besthostnews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.08 ▲0.40
Dashboard /wp-admin3.41 ▲0.11118.31 ▲63.17
Posts /wp-admin/edit.php3.36 ▲0.0150.88 ▼2.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.90 ▼15.37
Media Library /wp-admin/upload.php3.24 ▲0.0143.69 ▲1.60

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Besthostnews
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.74 ▲0.332.24 ▲0.4941.73 ▲0.37
Dashboard /wp-admin2,247 ▲595.83 ▲0.9394.50 ▼10.7141.42 ▼0.55
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0343.26 ▲5.7436.86 ▲2.70
Add New Post /wp-admin/post-new.php1,536 ▲1723.21 ▲0.06618.93 ▼61.3552.36 ▼4.67
Media Library /wp-admin/upload.php1,391 ▲64.21 ▲0.01100.07 ▼5.0652.38 ▲6.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-host-news/besthostnews.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (The dashboard widget.) image required
The official readme.txt is a good inspiration

best-host-news/besthostnews.php 92% from 13 tests

"Besthostnews" version 1.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("best-host-news.php" instead of "besthostnews.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected49 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP112949

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions3
▷ Named functions3100.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
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png64.80KB33.07KB▼ 48.96%