84% c4d-social-locker

Code Review | C4D Social Locker

WordPress plugin C4D Social Locker scored84%from 54 tests.

About plugin

  • Plugin page: c4d-social-locker
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.7.2
  • WordPress version: 6.3.1
  • First release: Aug 26, 2017
  • Latest release: Aug 26, 2017
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: coffee4dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /793 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by C4D Social Locker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.91 ▲0.71
Dashboard /wp-admin3.31 ▲0.0145.24 ▼1.13
Posts /wp-admin/edit.php3.37 ▲0.0150.71 ▲3.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.66 ▲7.23
Media Library /wp-admin/upload.php3.24 ▲0.0135.53 ▲0.09

Server storage [IO: ▲0.37MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for C4D Social Locker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13714.34 ▼0.3847.11 ▲45.6142.91 ▲3.01
Dashboard /wp-admin2,189 ▲125.62 ▲0.02110.13 ▲21.5453.32 ▲4.85
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0145.54 ▲9.3139.88 ▲6.25
Add New Post /wp-admin/post-new.php1,535 ▲724.43 ▲1.16665.66 ▼14.6469.19 ▲15.83
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.0998.03 ▲2.5339.24 ▼6.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/c4d-social-locker/c4d-social-locker.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
You can take inspiration from this readme.txt

c4d-social-locker/c4d-social-locker.php Passed 13 tests

The entry point to "C4D Social Locker" version 2.0.0 is a PHP file that has certain tags in its header comment area
45 characters long description:
Lock your content until the visitor share it.

Code Analysis Passed 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
No dangerous file extensions were detected2,090 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP22328771,762
JavaScript33213279
Sass11048
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity40.00
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods71
▷ Static methods34.23%
▷ Public methods2028.17%
▷ Protected methods5070.42%
▷ Private methods11.41%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin