84% easy-paypal-buttons

Code Review | Easy Paypal Buttons

WordPress plugin Easy Paypal Buttons scored84%from 54 tests.

About plugin

  • Plugin page: easy-paypal-buttons
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 6.3.1
  • First release: Aug 15, 2020
  • Latest release: Sep 12, 2020
  • Number of updates: 21
  • Update frequency: every 7.9 days
  • Top authors: salahudeen007 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /609 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.22ms] Passed 4 tests

This is a short check of server-side resources used by Easy Paypal Buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0940.91 ▼6.46
Dashboard /wp-admin3.41 ▲0.1053.52 ▲0.62
Posts /wp-admin/edit.php3.46 ▲0.1052.15 ▲4.15
Add New Post /wp-admin/post-new.php6.01 ▲0.1289.55 ▼11.20
Media Library /wp-admin/upload.php3.33 ▲0.1042.93 ▲6.77
Easy PayPal Buttons Setting /wp-admin/options-general.php?page=easypaypalbuttonAdminPage3.3034.87

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 148 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Paypal Buttons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.28 ▼1.071.75 ▼0.1438.54 ▼2.47
Dashboard /wp-admin2,227 ▲535.84 ▲0.2796.53 ▼1.9842.54 ▲1.74
Posts /wp-admin/edit.php2,134 ▲342.27 ▲0.2443.89 ▲4.5836.88 ▼0.38
Add New Post /wp-admin/post-new.php1,559 ▲3123.17 ▲0.05680.90 ▲29.1739.24 ▼12.28
Media Library /wp-admin/upload.php1,432 ▲324.32 ▲0.12115.25 ▲9.4449.05 ▲2.58
Easy PayPal Buttons Setting /wp-admin/options-general.php?page=easypaypalbuttonAdminPage1,8781.9029.14121.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-paypal-buttons/admin/admin.php:12

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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: paypal donate button, paypal buy button, paypal subscribe button

easy-paypal-buttons/index.php 92% from 13 tests

This is the main PHP file of "Easy Paypal Buttons" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("easy-paypal-buttons.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected9,805 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
CSS334252,802
SVG1002,671
Sass1434341,768
LESS1434441,758
PHP29028752
JavaScript2392254

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
65 PNG files occupy 1.06MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/imgs/subs/s15.png6.35KB3.01KB▼ 52.57%
admin/imgs/subs/s3.PNG3.35KB2.37KB▼ 29.34%
admin/imgs/d19.png5.52KB2.78KB▼ 49.60%
admin/imgs/buy/b31.png3.67KB2.30KB▼ 37.28%
admin/imgs/buy/b25.png4.75KB2.42KB▼ 49.10%