84% better-post-formats

Code Review | Better Post Formats

WordPress plugin Better Post Formats scored84%from 54 tests.

About plugin

  • Plugin page: better-post-formats
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 5, 2019
  • Latest release: Oct 18, 2021
  • Number of updates: 12
  • Update frequency: every 56.9 days
  • Top authors: rgblab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /705 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

This is a short check of server-side resources used by Better Post Formats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.66 ▼9.70
Dashboard /wp-admin3.39 ▲0.0950.55 ▼3.73
Posts /wp-admin/edit.php3.50 ▲0.1546.51 ▼9.52
Add New Post /wp-admin/post-new.php5.57 ▼0.3276.82 ▼31.04
Media Library /wp-admin/upload.php3.31 ▲0.0840.12 ▲2.71

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Better Post Formats
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲16513.99 ▼0.3911.89 ▲9.8448.60 ▲6.74
Dashboard /wp-admin2,221 ▲184.85 ▼1.01107.45 ▼2.3141.73 ▼5.58
Posts /wp-admin/edit.php2,082 ▼181.99 ▼0.0338.89 ▲0.4135.87 ▼2.27
Add New Post /wp-admin/post-new.php6,547 ▲5,00226.17 ▲2.92943.44 ▲268.5162.46 ▲3.61
Media Library /wp-admin/upload.php1,400 ▼34.12 ▼0.16110.85 ▲4.4949.05 ▼0.50

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 27× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/better-post-formats/components/quote/templates/media.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/better-post-formats/lib/frontend.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'betterPostFormatsHelper' not found in wp-content/plugins/better-post-formats/components/audio/load.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/better-post-formats/define.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'betterPostFormatsMeta' not found in wp-content/plugins/better-post-formats/components/quote/quote.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-post-formats/better-post-formats.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'betterPostFormatsHelper' not found in wp-content/plugins/better-post-formats/components/video/templates/meta-box.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/better-post-formats/components/gallery/templates/media.php:3
    • > PHP Warning
      Use of undefined constant BPF_ABS_PATH - assumed 'BPF_ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/better-post-formats/components/load.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-post-formats/components/common/load.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: featured media, featured image, post format

better-post-formats/better-post-formats.php 85% from 13 tests

Analyzing the main PHP file in "Better Post Formats" version 1.0.1
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 156 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,123 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
CSS12218281,099
JavaScript8164120874
PHP28148370732
Sass913113418

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.80
▷ Minimum class complexity2.00
▷ Maximum class complexity31.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1751.52%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin