10% s2member-addon-for-wp-courseware

Code Review | WP Courseware for S2Member

WordPress plugin WP Courseware for S2Member scored10%from 54 tests.

About plugin

  • Plugin page: s2member-addon-fo...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 8, 2013
  • Latest release: Dec 9, 2022
  • Number of updates: 18
  • Update frequency: every 199.6 days
  • Top authors: flyplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /6,374 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/s2member-addon-for-wp-courseware/wp-courseware-s2-member.php+17
    Undefined index: WS_PLUGIN__

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.44ms] Passed 4 tests

An overview of server-side resources used by WP Courseware for S2Member
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.22 ▲1.47
Dashboard /wp-admin3.31 ▲0.0147.08 ▲1.42
Posts /wp-admin/edit.php3.43 ▲0.0747.88 ▲0.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.25 ▼8.80
Media Library /wp-admin/upload.php3.23 ▲0.0137.45 ▲2.85

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Courseware for S2Member
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.56 ▼0.831.72 ▲0.0341.93 ▲1.12
Dashboard /wp-admin2,209 ▲204.85 ▼0.08110.72 ▼5.9742.24 ▼5.36
Posts /wp-admin/edit.php2,094 ▲81.99 ▼0.0240.10 ▲0.3137.96 ▲3.72
Add New Post /wp-admin/post-new.php1,545 ▲3123.25 ▲5.51672.33 ▼2.2561.89 ▲2.35
Media Library /wp-admin/upload.php1,394 ▲34.31 ▲0.14104.65 ▲0.3546.08 ▼3.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/s2member-addon-for-wp-courseware/wp-courseware-s2-member.php:23

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: learning management system, selling online courses

s2member-addon-for-wp-courseware/wp-courseware-s2-member.php 92% from 13 tests

"WP Courseware for S2Member" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("s2member-addon-for-wp-courseware.php" instead of "wp-courseware-s2-member.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin358 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2150208358

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity16.50
▷ Minimum class complexity5.00
▷ Maximum class complexity28.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods1664.00%
▷ Protected methods728.00%
▷ Private methods28.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin