72% sam-donation

Code Review | SAM Donation

WordPress plugin SAM Donation scored72%from 54 tests.

About plugin

  • Plugin page: sam-donation
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2015
  • Latest release: Feb 26, 2015
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: CAWeissen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /615 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.79ms] Passed 4 tests

This is a short check of server-side resources used by SAM Donation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.77 ▲2.33
Dashboard /wp-admin3.31 ▼0.0344.40 ▼12.58
Posts /wp-admin/edit.php3.36 ▲0.0147.28 ▲0.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.96 ▼29.38
Media Library /wp-admin/upload.php3.23 ▲0.0033.33 ▼1.40
SAM Donate /wp-admin/plugins.php?page=sam-admin3.1729.64

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
sam_options_group
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for SAM Donation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.15 ▼1.241.72 ▲0.1741.64 ▲1.31
Dashboard /wp-admin2,207 ▲195.84 ▲0.8198.13 ▼1.0938.47 ▼5.75
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0438.57 ▼0.8433.95 ▼3.00
Add New Post /wp-admin/post-new.php1,545 ▲2618.32 ▼4.86671.61 ▲29.4653.34 ▼8.02
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.1395.30 ▼19.4741.18 ▼6.96
SAM Donate /wp-admin/plugins.php?page=sam-admin8492.0222.5227.99

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • sam_options_group
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=sam-admin
    • > Notice in wp-content/plugins/sam-donation/sam-admin.php+20
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sam-donation/sam-donation.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/sam-donation/donate.php on line 65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sam-donation/sam-admin.php:35

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
5 plugin tags: donation, mission, sam, south america, donate

sam-donation/sam-donation.php 92% from 13 tests

The main PHP script in "SAM Donation" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 276 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected160 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32526160

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
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 Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png57.06KB15.25KB▼ 73.28%
assets/screenshot-1.png89.41KB33.99KB▼ 61.99%