10% add-button-to-post

Code Review | Add Button To Post

WordPress plugin Add Button To Post scored 10% from 54 tests.

About plugin

  • Plugin page: add-button-to-post
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 5.8.1
  • First release: May 22, 2013
  • Latest release: Jun 2, 2013
  • Number of updates: 30
  • Update frequency: every 0.4 days
  • Top authors: hopstep (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,387 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/add-button-to-post/add_button_to_post.php+97
    Use of undefined constant no - assumed 'no' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼0.88MB] [CPU: ▼174.96ms] Passed 4 tests

Analyzing server-side resources used by Add Button To Post
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1537.77 ▲16.89
Dashboard /wp-admin2.77 ▼0.2923.70 ▼24.56
Posts /wp-admin/edit.php2.77 ▼0.3427.46 ▼16.95
Add New Post /wp-admin/post-new.php2.77 ▼2.6621.34 ▼642.08
Media Library /wp-admin/upload.php2.77 ▼0.2320.11 ▼16.25
Add Button To Post /wp-admin/options-general.php?page=add-button-to-post/add_button_to_post.php2.7720.20

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add Button To Post: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.76 ▲0.2712.50 ▲2.9047.90 ▲3.20
Dashboard /wp-admin2,975 ▲415.92 ▼0.03138.63 ▼13.66110.86 ▲3.73
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0164.31 ▼2.3486.47 ▼9.89
Add New Post /wp-admin/post-new.php1,503 ▼18018.54 ▲0.08393.26 ▼9.47105.09 ▼10.60
Media Library /wp-admin/upload.php1,812 ▲645.01 ▲0.00159.22 ▲7.43114.94 ▼0.00
Add Button To Post /wp-admin/options-general.php?page=add-button-to-post/add_button_to_post.php1,1122.0661.0491.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=add-button-to-post/add_button_to_post.php
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/add-button-to-post/add_button_to_post_setting.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-button-to-post/add_button_to_post.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
Attributes that require attention:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

add-button-to-post/add_button_to_post.php 92% from 13 tests

This is the main PHP file of "Add Button To Post" version 1.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-button-to-post.php" instead of "add_button_to_post.php")

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
Success! There were no dangerous files found in this plugin272 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33126172
CSS16780
JavaScript11220

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions9
▷ Named functions9100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/twitter.png0.34KB0.33KB▼ 2.02%
images/comment.png1.04KB1.02KB▼ 2.53%
images/rss.png0.68KB0.73KB0.00%