77% customer-area

Code Review | WP Customer Area

WordPress plugin WP Customer Area scored 77% from 54 tests.

About plugin

  • Plugin page: customer-area
  • Plugin version: 8.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.1
  • WordPress version: 5.8.1
  • First release: Apr 30, 2013
  • Latest release: Sep 21, 2021
  • Number of updates: 367
  • Update frequency: every 8.4 days
  • Top authors: vprat (88.28%)tlartaud (11.99%)

Code review

54 tests

User reviews

74 reviews

Install metrics

10,000+ active / 471,455 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
Install script ran successfully

Server metrics [RAM: ▲4.35MB] [CPU: ▼106.76ms] 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.02 ▲4.3076.36 ▲57.06
Dashboard /wp-admin7.48 ▲4.42146.82 ▲98.99
Posts /wp-admin/edit.php7.53 ▲4.4282.83 ▲24.58
Add New Post /wp-admin/post-new.php9.75 ▲4.32129.11 ▼535.64
Media Library /wp-admin/upload.php7.34 ▲4.3463.96 ▲26.96
Logs /wp-admin/admin.php?page=wpca-logs7.4068.26
Status /wp-admin/admin.php?page=wpca-status7.3358.55
WP Customer Area /wp-admin/options-general.php?page=wpca-settings7.3261.69

Server storage [IO: ▲23.56MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 826 new files
Database: no new tables, 11 new options
New WordPress options
cuar/core/status/warning-messages
widget_cuar_private_page_categories
widget_cuar_private_files
cuar_deferred_actions
widget_cuar_private_file_categories
cuar_options
widget_cuar_private_page_authors
widget_cuar_private_file_archives
widget_cuar_private_pages
widget_cuar_private_file_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 /3,911 ▲33915.90 ▲0.2910.05 ▼0.5953.45 ▲1.58
Dashboard /wp-admin3,118 ▲1845.94 ▼0.06174.94 ▲9.83113.34 ▼6.61
Posts /wp-admin/edit.php2,890 ▲1512.87 ▲0.16100.76 ▲28.8397.12 ▲2.07
Add New Post /wp-admin/post-new.php1,724 ▲10921.39 ▼0.00333.57 ▲4.99113.13 ▼1.18
Media Library /wp-admin/upload.php1,958 ▲1545.07 ▲0.04180.20 ▲15.10136.97 ▲14.12
Logs /wp-admin/admin.php?page=wpca-logs1,7252.2370.6183.53
Status /wp-admin/admin.php?page=wpca-status1,4512.1065.29126.45
WP Customer Area /wp-admin/options-general.php?page=wpca-settings1,5042.7088.36110.49

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 11 options in the database
    • widget_cuar_private_file_authors
    • widget_cuar_private_file_archives
    • widget_cuar_private_page_archives
    • widget_cuar_private_page_categories
    • cuar_deferred_actions
    • widget_cuar_private_file_categories
    • cuar/core/status/warning-messages
    • widget_cuar_private_pages
    • widget_cuar_private_page_authors
    • cuar_options
    • ...

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
  • 22× 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-addons/admin-area/templates/private-post-list-filters-row-taxonomies.template.php
    • > /wp-content/plugins/customer-area/src/php/core-classes/templates/field-link.template.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-content-list.template.php
    • > /wp-content/plugins/customer-area/libs/php/automattic/parse-readme.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/shortcodes/templates/protected-content-shortcode-layout-default-before.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-addons/customer-account-edit/templates/customer-account-edit-content-field-group-close.template.php
    • > /wp-content/plugins/customer-area/src/php/core-classes/templates/widget-content-authors.template.php
    • > /wp-content/plugins/customer-area/src/php/core-addons/private-file/templates/private-attachments-add-methods-browser-scripts.template.php
  • 568× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'CUAR_INCLUDES_DIR/core-classes/addon-content-page.class.php' (include_path='.:/usr/share/php') 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/Content/list-table.class.php): failed to open stream: No such file or directory in wp-content/plugins/customer-area/src/php/core-addons/admin-area/private-container-table.class.php on line 19
    • > PHP Warning
      include_once(): Failed opening 'CUAR_INCLUDES_DIR/core-classes/object-meta/field/simple-field.class.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/customer-area/src/php/core-classes/object-meta/field/text-field.class.php on line 22
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/customer-area/src/php/core-addons/admin-area/templates/dashboard-part-addons.template.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/customer-area/src/php/helpers/bootstrap-nav-walker.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'CUAR_SimpleField' not found in wp-content/plugins/customer-area/src/php/core-classes/object-meta/field/text-field.class.php:29
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/customer-area/src/php/core-classes/templates/widget-content-dates.template.php:18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/customer-area/src/php/core-classes/templates/field.template.php on line 17
    • > PHP Notice
      Undefined variable: address_id in wp-content/plugins/customer-area/src/php/core-addons/addresses/templates/profile-edit-address.template.php on line 39
    • > 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/addon-content-page.class.php on line 20

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.0.6 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 detected196,890 lines of code in 668 files:
LanguageFilesBlank linesComment linesLines of code
PO File2939,43251,26095,133
PHP39610,47526,75486,310
JavaScript1642,0032,1227,229
SVG31802,707
LESS393491302,251
JSON10001,859
Markdown103850949
CSS113513338
YAML48269
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,391)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity52.12
▷ Minimum class complexity1.00
▷ Maximum class complexity4,391.00
Average method complexity4.97
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces12
Interfaces10
Traits0
Classes200
▷ Abstract classes2311.50%
▷ Concrete classes17788.50%
▷ Final classes00.00%
Methods2,786
▷ Static methods1836.57%
▷ Public methods1,97770.96%
▷ Protected methods76027.28%
▷ Private methods491.76%
Functions70
▷ Named functions6592.86%
▷ Anonymous functions57.14%
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
skins/frontend/master/assets/img/framework/sprites/news-logo_sprite.png6.57KB2.52KB▼ 61.60%
assets/common/img/payment-icons/color-light/chase-2.png1.23KB0.26KB▼ 78.44%
skins/frontend/master/assets/img/framework/plugins/details_close.png0.67KB0.79KB0.00%
assets/common/img/payment-icons/color-light/visa.png2.11KB0.94KB▼ 55.60%
assets/common/img/payment-icons/color-light/shopify.png2.12KB0.96KB▼ 54.57%