74% better-content

Code Review | Better Content

WordPress plugin Better Content scored74%from 54 tests.

About plugin

  • Plugin page: better-content
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Mar 29, 2016
  • Latest release: Apr 4, 2016
  • Number of updates: 9
  • Update frequency: every 0.8 days
  • Top authors: iamklaus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /631 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.62ms] Passed 4 tests

This is a short check of server-side resources used by Better Content
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.17 ▲2.19
Dashboard /wp-admin3.38 ▲0.0848.01 ▼0.51
Posts /wp-admin/edit.php3.43 ▲0.0842.64 ▼0.39
Add New Post /wp-admin/post-new.php5.96 ▲0.0881.43 ▼4.75
Media Library /wp-admin/upload.php3.30 ▲0.0836.27 ▼0.83

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: 2 new tables, 7 new options
New tables
wp_bettercontent_notifyme
wp_bettercontent_favorite
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_bettercontent_favorites_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Better Content
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14613.49 ▼0.959.38 ▲7.6042.89 ▼2.63
Dashboard /wp-admin2,195 ▲145.53 ▼0.1893.07 ▼19.1142.26 ▼0.96
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0536.11 ▲0.6331.75 ▼3.12
Add New Post /wp-admin/post-new.php1,526 ▼223.75 ▲0.46679.86 ▼0.4849.89 ▼4.95
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.0995.96 ▼14.9441.94 ▼7.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_bettercontent_favorite
    • wp_bettercontent_notifyme
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_bettercontent_favorites_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-content/favorites.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-content/favorites.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: notification, update, posts

better-content/bettercontent.php 92% from 13 tests

Analyzing the main PHP file in "Better Content" version 1.1
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("better-content.php" instead of "bettercontent.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected390 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP26833293
JavaScript112570
CSS14027

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
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
There are no PNG files in this plugin