84% better-formats

Code Review | Better Formats

WordPress plugin Better Formats scored84%from 54 tests.

About plugin

  • Plugin page: better-formats
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8
  • WordPress version: 6.3.1
  • First release: Jun 3, 2013
  • Latest release: Oct 18, 2013
  • Number of updates: 11
  • Update frequency: every 12.6 days
  • Top authors: Veraxus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /5,814 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.21ms] Passed 4 tests

A check of server-side resources used by Better Formats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.93 ▼7.82
Dashboard /wp-admin3.33 ▲0.0251.23 ▼0.20
Posts /wp-admin/edit.php3.38 ▲0.0245.56 ▼11.10
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.99 ▲2.28
Media Library /wp-admin/upload.php3.25 ▲0.0237.86 ▲5.15

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Better Formats
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.08 ▼0.271.72 ▲0.0845.62 ▲0.71
Dashboard /wp-admin2,199 ▲315.60 ▲0.0889.83 ▼0.2943.01 ▲0.72
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0634.42 ▼0.8534.11 ▼5.15
Add New Post /wp-admin/post-new.php1,530 ▼723.25 ▲5.17642.71 ▼22.0359.36 ▼14.87
Media Library /wp-admin/upload.php1,407 ▲74.25 ▼0.0098.55 ▼9.1245.67 ▲1.79

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-formats/init.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-formats/templates/meta-box.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-formats/templates/admin-help.php:14

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: ui, post, post-formats, usability, retina...

better-formats/init.php 92% from 13 tests

Analyzing the main PHP file in "Better Formats" version 0.2
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 ("better-formats.php" instead of "init.php")

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
Everything looks great! No dangerous files found in this plugin470 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
Sass1141177
PHP33472151
CSS1720127
JavaScript23415

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/formats-selected.png4.72KB3.04KB▼ 35.58%
assets/formats-sprite-2x.png6.00KB3.73KB▼ 37.85%
assets/formats-selected-2x.png9.00KB5.39KB▼ 40.13%
assets/formats-sprite.png3.56KB2.09KB▼ 41.31%