78% twittercart

Code Review | TwitterCart

WordPress plugin TwitterCart scored 78% from 54 tests.

About plugin

  • Plugin page: twittercart
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.5
  • WordPress version: 6.3.1
  • First release: Feb 2, 2015
  • Latest release: Apr 21, 2018
  • Number of updates: 66
  • Update frequency: every 17.9 days
  • Top authors: browserweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,305 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.28ms] Passed 4 tests

An overview of server-side resources used by TwitterCart
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.78 ▼2.49
Dashboard /wp-admin3.31 ▲0.0044.86 ▼2.67
Posts /wp-admin/edit.php3.36 ▲0.0048.53 ▲3.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.23 ▲7.47
Media Library /wp-admin/upload.php3.23 ▲0.0035.37 ▼3.31

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 170 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for TwitterCart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.32 ▲0.071.63 ▼2.6839.62 ▼4.61
Dashboard /wp-admin2,206 ▼35.81 ▼0.0396.47 ▼5.1340.45 ▲0.74
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0240.07 ▲6.1934.83 ▼0.63
Add New Post /wp-admin/post-new.php1,519 ▼1423.28 ▼0.10633.84 ▼32.2856.11 ▲1.28
Media Library /wp-admin/upload.php1,391 ▲34.31 ▲0.0495.44 ▼16.8447.22 ▲0.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 13× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/twittercart/includes/stats.php
    • > /wp-content/plugins/twittercart/includes/templates/ajax/timeline_result.php
    • > /wp-content/plugins/twittercart/includes/templates/myaccount_page.php
    • > /wp-content/plugins/twittercart/twitter-cart.php
    • > /wp-content/plugins/twittercart/includes/functions.php
    • > /wp-content/plugins/twittercart/includes/setup.php
    • > /wp-content/plugins/twittercart/includes/templates/support-page.php
    • > /wp-content/plugins/twittercart/includes/twitter.php
    • > /wp-content/plugins/twittercart/includes/user.php
    • > /wp-content/plugins/twittercart/includes/products.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/twittercart/includes/templates/products_page.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: social analytics, woocommerce, amazon cart, ecommerce, social...

twittercart/twitter-cart.php 92% from 13 tests

"TwitterCart" version 2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("twittercart.php" instead of "twitter-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin14,587 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111142845,378
CSS102,1602304,987
PHP166624892,813
PO File5634101,313
Markdown140096

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity59.00
▷ Minimum class complexity19.00
▷ Maximum class complexity99.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods1943.18%
▷ Protected methods00.00%
▷ Private methods2556.82%
Functions88
▷ Named functions88100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
110 PNG files occupy 0.31MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/nav_ico04.png1.22KB0.47KB▼ 61.72%
assets/images/tc_cross.png2.61KB2.07KB▼ 20.55%
assets/images/opt_ico02.png1.44KB0.78KB▼ 45.92%
assets/images/upd_ico01.png1.50KB0.91KB▼ 39.57%
assets/images/no_pic_fill.png2.09KB0.62KB▼ 70.43%