84% civicrm-contribution-page-widget

Code Review | CiviCRM Contribution Page Widget

WordPress plugin CiviCRM Contribution Page Widget scored84%from 54 tests.

About plugin

  • Plugin page: civicrm-contribut...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.2
  • WordPress version: 6.3.1
  • First release: Sep 10, 2015
  • Latest release: Sep 10, 2015
  • Number of updates: 4
  • Update frequency: every 15.8 days
  • Top authors: agh1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,076 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by CiviCRM Contribution Page Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.67 ▼3.39
Dashboard /wp-admin3.32 ▲0.0150.06 ▼4.38
Posts /wp-admin/edit.php3.37 ▲0.0152.43 ▼1.62
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.08 ▼15.53
Media Library /wp-admin/upload.php3.24 ▲0.0138.65 ▲2.04

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_civicontribute-widget
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for CiviCRM Contribution Page Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.071.80 ▲0.2343.85 ▼2.66
Dashboard /wp-admin2,195 ▲155.66 ▼0.0291.07 ▲0.7739.13 ▼6.96
Posts /wp-admin/edit.php2,100 ▲32.06 ▲0.0435.71 ▲0.6034.28 ▼2.10
Add New Post /wp-admin/post-new.php1,545 ▲1423.28 ▲0.14684.13 ▲31.3858.04 ▲11.10
Media Library /wp-admin/upload.php1,403 ▲34.14 ▼0.15109.39 ▲12.0048.26 ▲6.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_civicontribute-widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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 | 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
  • 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/civicrm-contribution-page-widget/civicontribute-widget.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: events, civicrm

civicrm-contribution-page-widget/civicontribute-widget.php 92% from 13 tests

The primary PHP file in "CiviCRM Contribution Page Widget" version 0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("civicrm-contribution-page-widget.php" instead of "civicontribute-widget.php")

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
Everything looks great! No dangerous files found in this plugin80 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1154780

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
PNG images were not found in this plugin