83% learnpress-wishlist

Code Review | LearnPress - Course Wishlist

WordPress plugin LearnPress - Course Wishlist scored83%from 54 tests.

About plugin

  • Plugin page: learnpress-wishlist
  • Plugin version: 4.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2015
  • Latest release: Sep 15, 2023
  • Number of updates: 47
  • Update frequency: every 64.1 days
  • Top authors: ThimPress (51.06%)tunnhn (17.02%)thongta (17.02%)halink0803 (10.64%)leehld (6.38%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20,000+ active /512,604 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.30ms] Passed 4 tests

An overview of server-side resources used by LearnPress - Course Wishlist
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.54 ▼3.48
Dashboard /wp-admin3.31 ▲0.0046.04 ▼1.80
Posts /wp-admin/edit.php3.36 ▲0.0046.82 ▼3.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.64 ▼20.82
Media Library /wp-admin/upload.php3.23 ▲0.0034.78 ▼1.24

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

LearnPress - Course Wishlist: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.021.70 ▼0.2641.50 ▼7.41
Dashboard /wp-admin2,206 ▲184.82 ▼0.05107.25 ▼1.6039.94 ▼2.84
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0434.08 ▼3.1634.53 ▼0.76
Add New Post /wp-admin/post-new.php1,535 ▼723.12 ▲4.87673.99 ▲68.4560.44 ▲8.01
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0997.91 ▼5.2541.71 ▼1.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'LearnPress\\Helpers\\Singleton' not found in wp-content/plugins/learnpress-wishlist/inc/Elementor/WishListElementorHandler.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'LearnPress\\ExternalPlugin\\Elementor\\LPElementorWidgetBase' not found in wp-content/plugins/learnpress-wishlist/inc/Elementor/Widgets/CourseWishlistElementor.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'LearnPress\\ExternalPlugin\\Elementor\\LPElementorControls' not found in wp-content/plugins/learnpress-wishlist/config/elementor/wishlist.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/learnpress-wishlist/inc/rest-api/class-rest-api.php:12

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
  • Screenshots: Add an image for screenshot #1 (LearnPress Prerequisite screenshot.)
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
Please take inspiration from this readme.txt

learnpress-wishlist/learnpress-wishlist.php Passed 13 tests

The entry point to "LearnPress - Course Wishlist" version 4.0.6 is a PHP file that has certain tags in its header comment area
17 characters long description:
Wishlist feature.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin900 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP12140262671
PO File2222482
CSS212478
JavaScript22169

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.17
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2371.88%
▷ Protected methods721.88%
▷ Private methods26.25%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.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
There are no PNG files in this plugin