10% social-locker

Code Review | OnePress Social Locker

WordPress plugin OnePress Social Locker scored 10% from 54 tests.

About plugin

  • Plugin page: social-locker
  • Plugin version: 5.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.4.2
  • WordPress version: 5.8.1
  • First release: Feb 24, 2013
  • Latest release: Jun 26, 2020
  • Number of updates: 195
  • Update frequency: every 13.8 days
  • Top authors: OnePressMedia (100%)

Code review

54 tests

User reviews

269 reviews

Install metrics

8,000+ active / 448,272 total downloads

Benchmarks

Plugin footprint 40% 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
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/social-locker/bizpanda/libs/onepress/licensing/licensing.php+65
    Undefined index: Category

Server metrics [RAM: ▲0.32MB] [CPU: ▼142.56ms] Passed 4 tests

An overview of server-side resources used by OnePress Social Locker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1335.00 ▲6.86
Dashboard /wp-admin3.45 ▲0.3940.94 ▼8.61
Posts /wp-admin/edit.php3.51 ▲0.4039.03 ▲1.10
Add New Post /wp-admin/post-new.php5.80 ▲0.3682.09 ▼569.58
Media Library /wp-admin/upload.php3.39 ▲0.3929.64 ▲7.07
All Lockers /wp-admin/edit.php?post_type=opanda-item3.5234.34
Global Settings /wp-admin/edit.php?post_type=opanda-item&page=settings-bizpanda3.7847.32
How to use? /wp-admin/edit.php?post_type=opanda-item&page=how-to-use-bizpanda3.1620.18
Stats & Reports /wp-admin/edit.php?post_type=opanda-item&page=stats-bizpanda3.4536.15
Go Premium /wp-admin/edit.php?post_type=opanda-item&page=premium-sociallocker-next3.4244.15
License Manager /wp-admin/edit.php?post_type=opanda-item&page=license-manager-sociallocker-next3.4128.46
+ New Locker /wp-admin/edit.php?post_type=opanda-item&page=new-item-bizpanda3.4127.26
Leads (0) /wp-admin/edit.php?post_type=opanda-item&page=leads-bizpanda3.4437.11

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 443 new files
Database: 3 new tables, 18 new options
New tables
wp_opanda_leads
wp_opanda_leads_fields
wp_opanda_stats_v2
New WordPress options
opanda_privacy_policy_text
opanda_tracking
opanda_privacy_enabled
onp_default_license_sociallocker-next
opanda_terms_enabled
opanda_facebook_version
factory_plugin_versions
factory_plugin_activated_bizpanda
opanda_facebook_app_id
opanda_default_signin_locker_id
...

Browser metrics Passed 4 tests

A check of browser resources used by OnePress Social Locker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,897 ▲27115.82 ▼0.246.87 ▲0.0077.26 ▲2.09
Dashboard /wp-admin3,129 ▲2366.28 ▲0.17121.25 ▼35.66180.38 ▼25.55
Posts /wp-admin/edit.php2,929 ▲1893.40 ▲0.1669.80 ▼2.50152.95 ▼6.67
Add New Post /wp-admin/post-new.php3,893 ▲18719.40 ▲0.84464.41 ▼2.16185.77 ▲7.76
Media Library /wp-admin/upload.php1,873 ▲1215.58 ▲0.10151.22 ▲4.20199.64 ▲7.36
All Lockers /wp-admin/edit.php?post_type=opanda-item2,6613.3969.18151.20
Global Settings /wp-admin/edit.php?post_type=opanda-item&page=settings-bizpanda2,4693.0279.77158.53
How to use? /wp-admin/edit.php?post_type=opanda-item&page=how-to-use-bizpanda1,5892.4255.56141.32
Stats & Reports /wp-admin/edit.php?post_type=opanda-item&page=stats-bizpanda2,1326.7487.97165.92
Go Premium /wp-admin/edit.php?post_type=opanda-item&page=premium-sociallocker-next2,3382.5275.13172.21
License Manager /wp-admin/edit.php?post_type=opanda-item&page=license-manager-sociallocker-next1,4632.4459.77215.91
+ New Locker /wp-admin/edit.php?post_type=opanda-item&page=new-item-bizpanda1,3722.4155.20120.43
Leads (0) /wp-admin/edit.php?post_type=opanda-item&page=leads-bizpanda1,4142.7975.43100.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_opanda_leads_fields
    • wp_opanda_leads
    • wp_opanda_stats_v2
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • factory_plugin_activated_bizpanda
    • opanda_terms_use_pages
    • opanda_facebook_version
    • factory_plugin_versions
    • opanda_default_signin_locker_id
    • opanda_tracking
    • factory_plugin_activated_sociallocker-next
    • opanda_robust_key
    • opanda_facebook_app_id
    • opanda_default_social_locker_id
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=opanda-item&page=how-to-use-bizpanda
    • > Notice in wp-content/plugins/social-locker/bizpanda/admin/pages/how-to-use.php+123
    Trying to access array offset on value of type null

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
The following issues need your attention
  • 222× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Factory325_Update' not found in wp-content/plugins/social-locker/plugin/updates/040105.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/social-locker/bizpanda/includes/assets-manager.php:1182
    • > PHP Warning
      require_once(OPANDA_BIZPANDA_DIR/includes/themes.php): failed to open stream: No such file or directory in wp-content/plugins/social-locker/bizpanda/includes/classes/themes-manager.class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'FactoryForms328_Control' not found in wp-content/plugins/social-locker/bizpanda/libs/factory/forms/controls/checkbox.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FactoryForms328_Holder' not found in wp-content/plugins/social-locker/bizpanda/libs/factory/forms/controls/holders/accordion.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'OPanda_StatsTable' not found in wp-content/plugins/social-locker/panda-items/signin-locker/admin/stats/profits.php:3
    • > PHP Warning
      require_once(OPANDA_BIZPANDA_DIR/admin/activation.php): failed to open stream: No such file or directory in wp-content/plugins/social-locker/bizpanda/admin/boot.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Factory325_Update' not found in wp-content/plugins/social-locker/plugin/updates/030009.php:8
    • > PHP Warning
      Use of undefined constant OPANDA_BIZPANDA_DIR - assumed 'OPANDA_BIZPANDA_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-locker/bizpanda/admin/boot.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/social-locker/panda-items/signin-locker/admin/help/gdpr.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: There are too many tags (77 tag instead of maximum 10)
You can look at the official readme.txt

social-locker/sociallocker-next.php 85% from 13 tests

The main file in "OnePress Social Locker" v. 5.6.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("social-locker.php" instead of "sociallocker-next.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 365 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin56,034 lines of code in 371 files:
LanguageFilesBlank linesComment linesLines of code
PHP2316,4168,19424,416
CSS621,70345017,103
JavaScript673,3501,68613,890
SVG100565
HTML108060

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.94
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces10
Interfaces3
Traits0
Classes177
▷ Abstract classes1910.73%
▷ Concrete classes15889.27%
▷ Final classes00.00%
Methods959
▷ Static methods15015.64%
▷ Public methods85689.26%
▷ Protected methods778.03%
▷ Private methods262.71%
Functions167
▷ Named functions167100.00%
▷ Anonymous functions00.00%
Constants89
▷ Global constants5865.17%
▷ Class constants3134.83%
▷ Public constants31100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
60 PNG files occupy 0.29MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bizpanda/libs/onepress/licensing/assets/img/trial-license-chip.png1.95KB0.73KB▼ 62.77%
bizpanda/extras/visual-composer/assets/vc-icons.png3.72KB1.98KB▼ 46.68%
bizpanda/libs/factory/bootstrap/assets/images/chosen-sprite.png0.63KB0.88KB0.00%
bizpanda/assets/admin/img/menu-icon.png1.29KB1.26KB▼ 2.42%
bizpanda/assets/admin/img/ajax-icon.png0.35KB0.25KB▼ 29.20%