78% pay-a-coffee

Code Review | Pay A Coffee Plugin for WordPress

WordPress plugin Pay A Coffee Plugin for WordPress scored 78% from 54 tests.

About plugin

  • Plugin page: pay-a-coffee
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 5.8.1
  • First release: Nov 28, 2014
  • Latest release: Dec 21, 2014
  • Number of updates: 15
  • Update frequency: every 1.5 days
  • Top authors: fjaviersantos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,152 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.91MB] [CPU: ▼175.73ms] Passed 4 tests

This is a short check of server-side resources used by Pay A Coffee Plugin for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1237.81 ▲18.96
Dashboard /wp-admin2.74 ▼0.3121.70 ▼30.01
Posts /wp-admin/edit.php2.74 ▼0.3724.98 ▼23.09
Add New Post /wp-admin/post-new.php2.74 ▼2.6924.73 ▼630.68
Media Library /wp-admin/upload.php2.74 ▼0.2721.27 ▼19.12
Pay A Coffee /wp-admin/options-general.php?page=PayACoffee2.7423.42

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pay A Coffee Plugin for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11216.23 ▲0.348.25 ▼1.3653.32 ▲1.30
Dashboard /wp-admin2,972 ▲415.89 ▼0.27144.61 ▼4.28112.82 ▼6.82
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0169.72 ▼5.9293.65 ▼6.19
Add New Post /wp-admin/post-new.php1,686 ▲1418.73 ▼0.03384.88 ▲23.37111.25 ▼11.36
Media Library /wp-admin/upload.php1,753 ▼544.99 ▼0.03154.68 ▼8.20124.61 ▼5.16
Pay A Coffee /wp-admin/options-general.php?page=PayACoffee1,1872.0960.6692.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or 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 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=PayACoffee
    • > 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.
    • > GET request to /wp-admin/options-general.php?page=PayACoffee
    • > Notice in wp-content/plugins/pay-a-coffee/payacoffee_options.php+2
    Undefined index: payacoffee_hidden

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 fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: payacoffee_hidden in wp-content/plugins/pay-a-coffee/payacoffee_options.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pay-a-coffee/payacoffee_options.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pay-a-coffee/payacoffee.php:34

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: You can look at the official readme.txt

pay-a-coffee/payacoffee.php 92% from 13 tests

The main PHP file in "Pay A Coffee Plugin for WordPress" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("pay-a-coffee.php" instead of "payacoffee.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
There were no executable files found in this plugin100 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2148100

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.04
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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/logo.png9.13KB5.41KB▼ 40.76%