68% paiementpro-for-give

Code Review | PaiementPro for Give

WordPress plugin PaiementPro for Give scored 68% from 54 tests.

About plugin

  • Plugin page: paiementpro-for-give
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.5
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Sep 15, 2020
  • Number of updates: 11
  • Update frequency: every 9.5 days
  • Top authors: paiementpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 601 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.72ms] Passed 4 tests

An overview of server-side resources used by PaiementPro for Give
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0348.13 ▲2.05
Dashboard /wp-admin3.34 ▲0.0360.95 ▼3.20
Posts /wp-admin/edit.php3.39 ▲0.0357.21 ▲0.21
Add New Post /wp-admin/post-new.php5.92 ▲0.03113.88 ▲2.80
Media Library /wp-admin/upload.php3.26 ▲0.0334.89 ▼1.94

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

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

Browser metrics Passed 4 tests

A check of browser resources used by PaiementPro for Give
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5513.31 ▼1.065.30 ▲3.0150.48 ▼6.07
Dashboard /wp-admin2,218 ▲335.80 ▼0.06127.39 ▼0.1951.48 ▲3.17
Posts /wp-admin/edit.php2,103 ▲142.02 ▼0.0243.93 ▲1.8540.10 ▲0.70
Add New Post /wp-admin/post-new.php1,551 ▲1823.24 ▼0.14823.13 ▲107.4363.97 ▲8.75
Media Library /wp-admin/upload.php1,397 ▲124.28 ▲0.04107.26 ▼24.3245.45 ▼8.44

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
    • > /wp-content/plugins/paiementpro-for-give/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php
  • 841× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/paiementpro-for-give/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/paiementpro-for-give/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/paiementpro-for-give/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/paiementpro-for-give/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\AbstractFunctionCallParameterSniff' not found in wp-content/plugins/paiementpro-for-give/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Core\\AbstractMethodUnitTest' not found in wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Global Settings screen), #2 (Donation Form Screen), #3 (Admin Gateways List Screen)
You can take inspiration from this readme.txt

paiementpro-for-give/paiementpro-for-give.php Passed 13 tests

Analyzing the main PHP file in "PaiementPro for Give" version 1.0.2
62 characters long description:
Accept donations for GiveWP using PaiementPro payment gateway.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/paiementpro-for-give/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
110,736 lines of code in 1,407 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,01321,90742,75692,736
XML1704297775,968
Pascal1112,4025,0995,092
Markdown1179103,142
JavaScript577568592,090
JSON900903
CSS3318992665
XSD160130
DOS Batch241010

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 332)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity14.86
▷ Minimum class complexity1.00
▷ Maximum class complexity480.00
Average method complexity6.14
▷ Minimum method complexity1.00
▷ Maximum method complexity332.00
Code structure
Namespaces190
Interfaces3
Traits0
Classes866
▷ Abstract classes212.42%
▷ Concrete classes84597.58%
▷ Final classes20.24%
Methods2,366
▷ Static methods763.21%
▷ Public methods1,88979.84%
▷ Protected methods40016.91%
▷ Private methods773.25%
Functions25
▷ Named functions1352.00%
▷ Anonymous functions1248.00%
Constants141
▷ Global constants10574.47%
▷ Class constants3625.53%
▷ Public constants36100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected