77% social-commerce-by-cedcommerce

Code Review | Social Commerce by CedCommerce

WordPress plugin Social Commerce by CedCommerce scored77%from 54 tests.

About plugin

  • Plugin page: social-commerce-b...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2020
  • Latest release: Oct 7, 2021
  • Number of updates: 9
  • Update frequency: every 42.0 days
  • Top authors: cedcommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /978 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Social Commerce by CedCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.28 ▼3.92
Dashboard /wp-admin3.31 ▼0.0443.09 ▼15.35
Posts /wp-admin/edit.php3.36 ▲0.0046.73 ▼0.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.97 ▼10.06
Media Library /wp-admin/upload.php3.23 ▲0.0033.60 ▼0.12

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 61 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Social Commerce by CedCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.25 ▼0.521.69 ▼0.0343.65 ▲2.06
Dashboard /wp-admin2,198 ▲215.54 ▼0.1183.54 ▼7.7739.31 ▼4.61
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0333.62 ▼2.5933.48 ▼4.41
Add New Post /wp-admin/post-new.php1,526 ▼523.72 ▲0.51678.82 ▲3.2763.49 ▲12.48
Media Library /wp-admin/upload.php1,403 ▼04.23 ▲0.0397.00 ▼0.1445.69 ▲2.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/social-commerce-by-cedcommerce/public/partials/facebook-marketplace-connector-for-woocommerce-public-display.php
    • > /wp-content/plugins/social-commerce-by-cedcommerce/admin/partials/facebook-marketplace-connector-for-woocommerce-admin-display.php
    • > /wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/vendor/firebase/php-jwt/tests/bootstrap.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require(): Failed opening required 'CED_FMCW_DIRPATH/admin/lib/jwt/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/decode-jwt-token.php on line 2
    • > PHP Notice
      Undefined variable: page_id in wp-content/plugins/social-commerce-by-cedcommerce/admin/partials/single-feed-view.php on line 10
    • > PHP Fatal error
      Uncaught Firebase\\JWT\\ExpiredException: Expired token in wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/vendor/firebase/php-jwt/src/JWT.php:134
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_attribute_taxonomies() in wp-content/plugins/social-commerce-by-cedcommerce/admin/partials/settings-view.php:2
    • > PHP Warning
      Use of undefined constant CED_FMCW_DIRPATH - assumed 'CED_FMCW_DIRPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/decode-jwt-token.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/vendor/firebase/php-jwt/tests/JWTTest.php:7
    • > PHP Warning
      require(CED_FMCW_DIRPATH/admin/lib/jwt/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/social-commerce-by-cedcommerce/admin/lib/jwt/decode-jwt-token.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

social-commerce-by-cedcommerce/social-commerce-by-cedcommerce.php 77% from 13 tests

This is the main PHP file of "Social Commerce by CedCommerce" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 187 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Git Repository: Please do not include Git repositories in your plugin

Code Analysis 97% from 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
There were no executable files found in this plugin13,808 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP509361,7616,396
JSON5005,684
CSS2718964
JavaScript24583518
Markdown2440182
Bourne Shell12431
XML11018
YAML14015

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 168)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity39.36
▷ Minimum class complexity1.00
▷ Maximum class complexity577.00
Average method complexity5.16
▷ Minimum method complexity1.00
▷ Maximum method complexity168.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods204
▷ Static methods199.31%
▷ Public methods19595.59%
▷ Protected methods00.00%
▷ Private methods94.41%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/fbmp.png16.17KB6.55KB▼ 59.48%
admin/images/ced-logo.png0.93KB0.87KB▼ 6.90%
admin/images/icon.png9.15KB0.80KB▼ 91.21%