73% wpgcontacts

Code Review | WPGContacts

WordPress plugin WPGContacts scored73%from 54 tests.

About plugin

  • Plugin page: wpgcontacts
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Mar 6, 2023
  • Latest release: Apr 15, 2023
  • Number of updates: 3
  • Update frequency: every 24.7 days
  • Top authors: westerndeal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /122 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

This is a short check of server-side resources used by WPGContacts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.44 ▲0.16
Dashboard /wp-admin3.34 ▼0.0052.72 ▼13.16
Posts /wp-admin/edit.php3.40 ▲0.0452.98 ▼0.36
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.99 ▼14.62
Media Library /wp-admin/upload.php3.27 ▲0.0433.05 ▼4.58

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 944 new files
Database: no new tables, 13 new options
New WordPress options
wpgoco_token
wpgoco_verify
db_upgraded
theysaidso_admin_options
can_compress_scripts
wpgoco_ninjaform_field_map
wpgoco_gravityform_field_map
widget_recent-posts
wpgoco_access_code
widget_recent-comments
...

Browser metrics Passed 4 tests

WPGContacts: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.35 ▼0.011.81 ▼0.2441.49 ▼2.48
Dashboard /wp-admin2,211 ▲375.64 ▲0.1088.12 ▼3.0340.66 ▼0.14
Posts /wp-admin/edit.php2,116 ▲161.98 ▲0.0140.32 ▲4.0835.82 ▼0.53
Add New Post /wp-admin/post-new.php1,539 ▲623.51 ▲0.26711.28 ▲53.5252.82 ▲0.04
Media Library /wp-admin/upload.php1,419 ▲194.17 ▲0.0096.26 ▼10.4442.46 ▼5.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wpgcontacts/WPGContacts.php+171
    Use of undefined constant WP_GOOGLE_CONTACT_FREE_PRODUCT_NAME - assumed 'WP_GOOGLE_CONTACT_FREE_PRODUCT_NAME' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • wpgoco_wpform_field_map
    • wpgoco_cf7_field_map
    • widget_recent-posts
    • wpgoco_ninjaform_field_map
    • wpgoco_gravityform_field_map
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 508× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/wpgcontacts/lib/vendor/guzzlehttp/psr7/src/UploadedFile.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/wpgcontacts/lib/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Warning
      Class 'Google\\Http\\Batch' not found in wp-content/plugins/wpgcontacts/lib/vendor/google/apiclient/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/wpgcontacts/lib/vendor/google/apiclient-services/src/PeopleService/UpdateContactGroupRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Service\\Resource' not found in wp-content/plugins/wpgcontacts/lib/vendor/google/apiclient-services/src/PeopleService/Resource/People.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/wpgcontacts/lib/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/wpgcontacts/lib/vendor/google/apiclient-services/src/PeopleService/Photo.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\BCMath\\Reductions\\Barrett' not found in wp-content/plugins/wpgcontacts/lib/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wpgcontacts/lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wpgcontacts/lib/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php:26

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 90% 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
7 plugin tags: google contacts integrations, gravity forms, contact form 7, gcontacts, wpforms...

wpgcontacts/WPGContacts.php 77% from 13 tests

The main PHP script in "WPGContacts" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Requires at least: Required version does not match the one declared in readme.txt ("5.3" instead of "4.9")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpgcontacts.php" instead of "WPGContacts.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin94,857 lines of code in 901 files:
LanguageFilesBlank linesComment linesLines of code
PHP83713,13748,59586,152
Markdown311,76905,265
JSON22002,367
CSS15434421
JavaScript15352297
PO File19194232
YAML522391
XML10019
Dockerfile18010
Bourne Shell1203

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.35
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces86
Interfaces39
Traits14
Classes760
▷ Abstract classes21728.55%
▷ Concrete classes54371.45%
▷ Final classes448.10%
Methods4,835
▷ Static methods72915.08%
▷ Public methods3,91680.99%
▷ Protected methods3968.19%
▷ Private methods52310.82%
Functions216
▷ Named functions7534.72%
▷ Anonymous functions14165.28%
Constants676
▷ Global constants9514.05%
▷ Class constants58185.95%
▷ Public constants54693.98%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/vendor/rapidwebltd/php-google-people-api/assets/images/php-google-people-api.png78.10KB35.91KB▼ 54.02%
assets/img/permission_screen.png29.71KB9.43KB▼ 68.24%
assets/img/help.png1.51KB1.35KB▼ 10.25%
assets/img/cf7.png1.15KB0.56KB▼ 51.53%
assets/img/arrow.png4.19KB2.29KB▼ 45.36%