68% wpcomplete

Code Review | WPComplete

WordPress plugin WPComplete scored68%from 54 tests.

About plugin

  • Plugin page: wpcomplete
  • Plugin version: 2.9.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-6.1
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Jan 5, 2023
  • Number of updates: 56
  • Update frequency: every 41.7 days
  • Top authors: zackgilbert (92.86%)layotte (5.36%)jthillithemes (5.36%)

Code review

54 tests

User reviews

37 reviews

Install metrics

2,000+ active /19,133 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼3.24ms] Passed 4 tests

Analyzing server-side resources used by WPComplete
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1845.64 ▲0.32
Dashboard /wp-admin3.50 ▲0.1550.35 ▼15.64
Posts /wp-admin/edit.php3.55 ▲0.1951.43 ▲1.74
Add New Post /wp-admin/post-new.php6.04 ▲0.1591.31 ▲0.76
Media Library /wp-admin/upload.php3.36 ▲0.1340.77 ▲1.60
WPComplete /wp-admin/options-general.php?page=wpcomplete3.3833.35

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 117 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WPComplete
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲17313.84 ▼0.5410.04 ▲7.9940.73 ▼4.54
Dashboard /wp-admin2,238 ▲505.15 ▼0.71104.17 ▼15.5440.73 ▼3.01
Posts /wp-admin/edit.php2,183 ▲942.46 ▲0.4639.66 ▲1.6733.78 ▲1.38
Add New Post /wp-admin/post-new.php6,266 ▲4,73326.08 ▲3.19906.47 ▲257.5137.28 ▼23.58
Media Library /wp-admin/upload.php1,430 ▲424.57 ▲0.38111.62 ▲6.4946.03 ▼1.49
WPComplete /wp-admin/options-general.php?page=wpcomplete9582.1428.6630.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-devmode-notice.php
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-button-completion.php
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-settings-license-status.php
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-user-completion-column.php
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-post-completion.php
    • > /wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-user-completion.php
  • 91× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: user_completed in wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-button-completion.php on line 15
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-button-completion.php on line 33
    • > PHP Notice
      Undefined index: ithemes_updater_path in wp-content/plugins/wpcomplete/lib/updater/settings-page.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpcomplete/public/partials/themes/classic/bar-graph.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-settings-zapier.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wpcomplete/public/partials/wpcomplete-public-reset-link.php:2
    • > PHP Warning
      require_once(/settings.php): failed to open stream: No such file or directory in wp-content/plugins/wpcomplete/lib/updater/admin.php on line 33
    • > PHP Notice
      Undefined variable: msg in wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-devmode-notice.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpcomplete/public/partials/wpcomplete-public-loading-button.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wpcomplete/admin/partials/wpcomplete-admin-settings-auto-append.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 22 tag instead of maximum 10
You can take inspiration from this readme.txt

wpcomplete/wpcomplete.php Passed 13 tests

The main file in "WPComplete" v. 2.9.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
112 characters long description:
A WordPress plugin that helps your students keep track of their progress through your course or membership site.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wpcomplete/lib/updater/ca/roots.crt
14,899 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP682,8483,26910,850
CSS648123,361
JavaScript36037504
PO File36373184

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity69.84
▷ Minimum class complexity1.00
▷ Maximum class complexity564.00
Average method complexity5.77
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes13.23%
Methods444
▷ Static methods5612.61%
▷ Public methods30769.14%
▷ Protected methods10122.75%
▷ Private methods368.11%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

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.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/updater/images/logo-ithemes.png0.31KB0.37KB0.00%
lib/updater/images/ithemes-logo-header.png3.83KB2.37KB▼ 38.28%
lib/updater/images/icon-settings.png0.45KB0.58KB0.00%
lib/updater/images/icon-unlicensed.png0.52KB0.72KB0.00%
lib/updater/images/icon-unrecognized.png3.43KB0.76KB▼ 77.74%