77% customer-area

Code Review | WP Customer Area

WordPress plugin WP Customer Area scored77%from 54 tests.

About plugin

  • Plugin page: customer-area
  • Plugin version: 8.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 30, 2013
  • Latest release: Jul 26, 2023
  • Number of updates: 384
  • Update frequency: every 9.7 days
  • Top authors: vprat (86.46%)tlartaud (13.8%)

Code review

54 tests

User reviews

84 reviews

Install metrics

10,000+ active /557,587 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲4.44MB] [CPU: ▲17.65ms] Passed 4 tests

A check of server-side resources used by WP Customer Area
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /7.78 ▲4.3159.49 ▲19.47
Dashboard /wp-admin7.80 ▲4.4580.30 ▲18.47
Posts /wp-admin/edit.php7.92 ▲4.5677.04 ▲24.66
Add New Post /wp-admin/post-new.php10.40 ▲4.51113.05 ▲7.98
Media Library /wp-admin/upload.php7.72 ▲4.4868.86 ▲33.91
WP Customer Area /wp-admin/options-general.php?page=wpca-settings7.6957.26
Logs /wp-admin/admin.php?page=wpca-logs7.7759.57
Status /wp-admin/admin.php?page=wpca-status7.7055.93

Server storage [IO: ▲25.67MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 25.67MB)
Filesystem: 903 new files
Database: no new tables, 17 new options
New WordPress options
widget_cuar_private_files
widget_theysaidso_widget
cuar/core/status/warning-messages
widget_cuar_private_file_archives
can_compress_scripts
widget_cuar_private_page_categories
widget_cuar_private_file_authors
db_upgraded
widget_recent-posts
widget_cuar_private_page_authors
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Customer Area
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲20914.35 ▼0.202.04 ▲0.1742.14 ▲1.36
Dashboard /wp-admin2,318 ▲1415.62 ▲0.0496.38 ▲9.7944.43 ▲0.42
Posts /wp-admin/edit.php2,220 ▲1202.18 ▲0.1937.13 ▲1.1835.22 ▲4.74
Add New Post /wp-admin/post-new.php1,629 ▲9822.92 ▼0.05672.04 ▲5.8866.43 ▲9.90
Media Library /wp-admin/upload.php1,523 ▲1294.23 ▲0.0896.64 ▼5.2944.79 ▼0.87
WP Customer Area /wp-admin/options-general.php?page=wpca-settings1,2102.1435.7836.84
Logs /wp-admin/admin.php?page=wpca-logs1,3421.8228.6625.97
Status /wp-admin/admin.php?page=wpca-status1,1251.6725.7133.26

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 does not fully uninstall, leaving 17 options in the database
    • widget_theysaidso_widget
    • widget_cuar_private_page_archives
    • db_upgraded
    • cuar/core/status/warning-messages
    • widget_cuar_private_files
    • widget_cuar_private_page_categories
    • widget_recent-comments
    • widget_cuar_private_file_authors
    • widget_cuar_private_page_authors
    • cuar_deferred_actions
    • ...

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 24× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/customer-area/src/php/core-classes/templates/collections-button-group.template.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/customer-pages/templates/pagination.template.php
    • > /wp-content/plugins/customer-area/src/php/core-classes/templates/widget-content-list.template.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/admin-area/templates/private-post-list-filters-row-taxonomies.template.php
    • > /wp-content/plugins/customer-area/libs/php/automattic/parse-readme.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/post-owner/templates/post-owner-fields-readonly.template.php
    • > /wp-content/plugins/customer-area/src/php/core-classes/templates/widget-terms-cloud.template.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/payments/templates/settings-payment-icons-scripts.template.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/customer-account-edit/templates/customer-account-edit-content-field-group-open.template.php
    • > /wp-content/plugins/customer-area/libs/php/vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php
  • 564× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(CUAR_INCLUDES_DIR/core-classes/object-meta/field/simple-field.class.php): failed to open stream: No such file or directory in wp-content/plugins/customer-area/src/php/core-classes/object-meta/field/email-field.class.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/customer-area/src/php/core-addons/payments/templates/payment-history-inline.template.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CUAR_Shortcode' not found in wp-content/plugins/customer-area/src/php/core-addons/shortcodes/shortcodes/menu-shortcode.class.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_date_from_gmt() in wp-content/plugins/customer-area/src/php/core-addons/payments/templates/payment-editor-note-list-item.template.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'CUAR_INCLUDES_DIR/core-classes/addon.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/customer-area/src/php/core-addons/log/log-addon.class.php on line 19
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/customer-area/src/php/core-addons/customer-pages/templates/pagination.template.php on line 17
    • > PHP Warning
      require_once(CUAR_INCLUDES_DIR/core-classes/addon-content-page.class.php): failed to open stream: No such file or directory in wp-content/plugins/customer-area/src/php/core-addons/customer-private-pages/customer-private-pages-addon.class.php on line 19
    • > PHP Warning
      require_once(CUAR_INCLUDES_DIR/core-classes/addon-page.class.php): failed to open stream: No such file or directory in wp-content/plugins/customer-area/src/php/core-classes/widget-terms.class.php on line 19
    • > PHP Fatal error
      require_once(): Failed opening required 'CUAR_INCLUDES_DIR/core-classes/addon-page.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/customer-area/src/php/core-classes/addon-edit-content-page.class.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/customer-area/src/php/core-classes/templates/content-page-content-dashboard.template.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

customer-area/customer-area.php 92% from 13 tests

The main PHP file in "WP Customer Area" ver. 8.2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected208,620 lines of code in 736 files:
LanguageFilesBlank linesComment linesLines of code
PO File2943,92856,659105,314
PHP39810,58827,11987,301
JavaScript1642,0302,1377,431
SVG761802,834
LESS393501312,254
JSON8002,148
Markdown93910955
CSS113533338
XML21445

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,415)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 500)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity52.57
▷ Minimum class complexity1.00
▷ Maximum class complexity4,415.00
Average method complexity4.99
▷ Minimum method complexity1.00
▷ Maximum method complexity500.00
Code structure
Namespaces12
Interfaces10
Traits0
Classes200
▷ Abstract classes2311.50%
▷ Concrete classes17788.50%
▷ Final classes00.00%
Methods2,794
▷ Static methods1826.51%
▷ Public methods1,98170.90%
▷ Protected methods76127.24%
▷ Private methods521.86%
Functions71
▷ Named functions6591.55%
▷ Anonymous functions68.45%
Constants166
▷ Global constants15693.98%
▷ Class constants106.02%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
54 PNG files occupy 0.24MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/common/img/payment-icons/color-light/shopify.png2.12KB0.96KB▼ 54.57%
assets/common/img/payment-icons/color-light/worldpay.png2.02KB0.88KB▼ 56.46%
assets/common/img/payment-icons/color-light/discover.png2.18KB1.08KB▼ 50.16%
skins/frontend/master/assets/img/framework/sprites/favicons.png5.86KB2.38KB▼ 59.31%
skins/frontend/master/assets/img/framework/plugins/arrow_left_12x12.png0.21KB0.16KB▼ 23.74%