64% rest-cent-donations

Code Review | Rest-Cent Donations

WordPress plugin Rest-Cent Donations scored64%from 54 tests.

About plugin

  • Plugin page: rest-cent-donations
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2023
  • Latest release: Feb 6, 2023
  • Number of updates: 3
  • Update frequency: every 4.3 days
  • Top authors: restcent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /342 total downloads

Benchmarks

Plugin footprint 48% 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.00MB] [CPU: ▼6.75ms] Passed 4 tests

Server-side resources used by Rest-Cent Donations
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.61 ▼7.72
Dashboard /wp-admin3.31 ▲0.0044.38 ▼10.07
Posts /wp-admin/edit.php3.36 ▲0.0049.05 ▲0.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.75 ▼6.16
Media Library /wp-admin/upload.php3.23 ▲0.0033.85 ▼3.05

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Rest-Cent Donations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.23 ▼1.051.61 ▼0.5339.05 ▼4.96
Dashboard /wp-admin2,206 ▲154.80 ▼0.14108.67 ▼9.6538.10 ▼9.57
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0038.99 ▲0.3834.48 ▲0.13
Add New Post /wp-admin/post-new.php1,519 ▼023.19 ▼0.10670.06 ▲4.7269.64 ▲12.04
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0198.67 ▼14.1042.21 ▼6.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Error in wp-content/plugins/rest-cent-donations/uninstall.php+31
    Uncaught Error: Call to undefined function wc_get_product_id_by_sku() in wp-content/plugins/rest-cent-donations/uninstall.php:31
    Stack trace:
    #0 wp-admin/includes/plugin.php(1245): include_once()
    #1 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 28 files (0.24MB) in the plugin directory
    • (new file) admin/partials/rest-cent-admin-display.php
    • (new file) includes/class-rest-cent-i18n.php
    • (new file) includes/class-rest-cent-deactivator.php
    • (new file) README.txt
    • (new file) admin/index.php
    • (new file) admin/css/rest-cent-admin.css
    • (new file) includes/class-rest-cent-activator.php
    • (new file) admin/js/rest-cent-admin.js
    • (new file) LICENSE.txt
    • (new file) admin/class-rest-cent-admin.php
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rest-cent-donations/admin/partials/rest-cent-admin-display.php
    • > /wp-content/plugins/rest-cent-donations/public/partials/rest-cent-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: rest-cent, donations, charity, spenden

rest-cent-donations/rest-cent.php 92% from 13 tests

"Rest-Cent Donations" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("rest-cent-donations.php" instead of "rest-cent.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,550 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP123215641,942
CSS28421406
PO File1570196
JavaScript24326

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity27.29
▷ Minimum class complexity1.00
▷ Maximum class complexity154.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods64
▷ Static methods46.25%
▷ Public methods5992.19%
▷ Protected methods00.00%
▷ Private methods57.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/rest_log.png22.07KB10.65KB▼ 51.74%
public/css/rest-cent.png2.41KB1.59KB▼ 34.04%
public/css/rc-icon.png6.05KB3.07KB▼ 49.25%
public/css/1.png56.53KB21.90KB▼ 61.26%