10% socialcurrency

Code Review | SocialCurrency

WordPress plugin SocialCurrency scored10%from 54 tests.

About plugin

  • Plugin page: socialcurrency
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Nov 1, 2016
  • Number of updates: 9
  • Update frequency: every 2.1 days
  • Top authors: lgils (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /501 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/socialcurrency/backend/find_easylist_matches.php+20
    file_get_contents(http://wp.com/wp-content/plugins/socialcurrency-plugin/static/easylist.txt): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.41ms] Passed 4 tests

This is a short check of server-side resources used by SocialCurrency
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0438.76 ▼5.82
Dashboard /wp-admin3.33 ▲0.0348.30 ▲3.18
Posts /wp-admin/edit.php3.37 ▲0.0246.30 ▼6.42
Add New Post /wp-admin/post-new.php5.90 ▲0.0293.00 ▼8.56
Media Library /wp-admin/upload.php3.25 ▲0.0340.53 ▲3.84

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
scrr_easylist
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for SocialCurrency
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲20613.20 ▼1.211.93 ▼0.0751.53 ▲8.76
Dashboard /wp-admin2,225 ▲375.03 ▼1.01104.70 ▼6.5739.63 ▼4.55
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0536.94 ▼5.3533.44 ▼0.51
Add New Post /wp-admin/post-new.php1,527 ▼617.86 ▼5.37625.91 ▼29.6148.20 ▼20.98
Media Library /wp-admin/upload.php1,401 ▲134.17 ▼0.0595.43 ▼25.7740.55 ▼7.62

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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • scrr_easylist
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/socialcurrency-plugin/templates/screen-one.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/socialcurrency/scrr-plugin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/socialcurrency/socialcurrency-plugin/scrr-plugin.php:15
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/socialcurrency-plugin/templates/screen-one.php on line 12
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/templates/screen-one.php on line 26
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/templates/screen-one.php on line 26
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/templates/screen-one.php on line 12
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/templates/screen-one.php on line 12
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/socialcurrency-plugin/templates/screen-one.php on line 12
    • > PHP Warning
      Use of undefined constant SCRR__STATIC_FILES - assumed 'SCRR__STATIC_FILES' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialcurrency/socialcurrency-plugin/templates/screen-one.php on line 26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === socialcurrency === )
The official readme.txt is a good inspiration

socialcurrency/scrr-plugin.php 92% from 13 tests

"SocialCurrency" version 0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("socialcurrency.php" instead of "scrr-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin726 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript19743312
PHP85236254
CSS1260160

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.15MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
socialcurrency-plugin/assets/screenshot-2.png24.44KB6.80KB▼ 72.16%
socialcurrency-plugin/static/img/twtr-icon.png14.87KB3.51KB▼ 76.37%
static/img/fb-icon.png10.23KB1.76KB▼ 82.78%
socialcurrency-plugin/static/img/fb-icon.png10.23KB1.76KB▼ 82.78%
socialcurrency-plugin/assets/screenshot-1.png44.96KB12.88KB▼ 71.36%