72% social-locker-content

Code Review | Social Locker - Increase Traffic

WordPress plugin Social Locker - Increase Traffic scored72%from 54 tests.

About plugin

  • Plugin page: social-locker-con...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 10, 2014
  • Latest release: Jun 25, 2014
  • Number of updates: 10
  • Update frequency: every 1.5 days
  • Top authors: umarbajwa (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /6,821 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.20ms] Passed 4 tests

A check of server-side resources used by Social Locker - Increase Traffic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1547.15 ▲1.73
Dashboard /wp-admin3.44 ▲0.1049.63 ▼21.13
Posts /wp-admin/edit.php3.56 ▲0.2052.61 ▲2.72
Add New Post /wp-admin/post-new.php6.03 ▲0.1498.02 ▼6.62
Media Library /wp-admin/upload.php3.37 ▲0.1440.13 ▲1.23
Add New /wp-admin/post-new.php?post_type=wpsclp_locker3.5056.17
All Locker /wp-admin/edit.php?post_type=wpsclp_locker3.4139.88

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Social Locker - Increase Traffic
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲14313.83 ▼0.399.57 ▲7.9747.65 ▲5.81
Dashboard /wp-admin2,222 ▲455.67 ▲0.0986.40 ▼7.3339.73 ▲0.99
Posts /wp-admin/edit.php2,130 ▲301.95 ▼0.0841.63 ▲2.5634.74 ▼2.60
Add New Post /wp-admin/post-new.php1,549 ▲1223.11 ▲5.09650.32 ▼6.6055.74 ▼13.59
Media Library /wp-admin/upload.php1,430 ▲304.21 ▲0.05103.72 ▼8.1144.56 ▼0.69
Add New /wp-admin/post-new.php?post_type=wpsclp_locker2,3707.57168.4581.11
All Locker /wp-admin/edit.php?post_type=wpsclp_locker1,1702.0944.4930.24

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/social-locker-content/includes/libs/sharrre.php
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: locker_id in wp-content/plugins/social-locker-content/views/themes/default/template.php on line 1
    • > PHP Notice
      Undefined index: url in wp-content/plugins/social-locker-content/includes/libs/sharrre.php on line 5
    • > PHP Notice
      Undefined variable: locker_id in wp-content/plugins/social-locker-content/views/themes/theme2/auto_template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Wpsclp_Locker_Theme_Handler' not found in wp-content/plugins/social-locker-content/includes/classes/class-wpsclp-custom-buttons-theme.php:3
    • > PHP Notice
      Undefined index: type in wp-content/plugins/social-locker-content/includes/libs/sharrre.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/social-locker-content/views/themes/theme2/template.php:1
    • > PHP Notice
      Undefined variable: post_status in wp-content/plugins/social-locker-content/views/admin-settings/custom_publish_meta_box.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/social-locker-content/views/admin-settings/locker_shortcode_meta_box.php:5
    • > PHP Notice
      Undefined variable: locker_id in wp-content/plugins/social-locker-content/views/themes/default/auto_template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-locker-content/wp-sclp.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wpsclp_locker
    • > Javascript (severe) in unknown
    /wp-content/plugins/social-locker-content/js/jquery.ibutton.min.js?ver=1.0 20:630 Uncaught TypeError: Cannot set properties of undefined (setting 'iphone')
    • > GET request to /wp-admin/post-new.php?post_type=wpsclp_locker
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28609 "jQuery.Deferred exception: C is not a constructor" "TypeError: C is not a constructor\n at HTMLInputElement.\u003Canonymous> (/wp-content/plugins/social-locker-content/js/jquery.ibutton.min.js?ver=1.0:21:589)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:1594)\n at E.fn.iButton (/wp-content/plugins/social-locker-content/js/jquery.ibutton.min.js?ver=1.0:21:573)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/social-locker-content/js/wpsclp-locker-admin.js?ver=1.0:57:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=wpsclp_locker
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28721 Uncaught TypeError: C is not a constructor

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 26 tag instead of maximum 10
Please take inspiration from this readme.txt

social-locker-content/wp-sclp.php 92% from 13 tests

Analyzing the main PHP file in "Social Locker - Increase Traffic" version 1.1
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-content.php" instead of "wp-sclp.php")

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
Everything looks great! No dangerous files found in this plugin2,668 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS4186141,099
PHP19518221,016
JavaScript66395553

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity18.50
▷ Minimum class complexity3.00
▷ Maximum class complexity42.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods50100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery-ibutton/images/ibutton-slider-giva2.png4.20KB2.68KB▼ 36.22%
css/jquery-ibutton/images/ibutton-slider-default.png4.50KB2.79KB▼ 37.94%
css/jquery-ibutton/images/ibutton-slider-giva-original.png4.37KB2.79KB▼ 36.33%