77% twitter-plugin

Code Review | BestWebSoft's Twitter

WordPress plugin BestWebSoft's Twitter scored77%from 54 tests.

About plugin

  • Plugin page: twitter-plugin
  • Plugin version: 2.64
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: May 24, 2011
  • Latest release: Aug 10, 2023
  • Number of updates: 114
  • Update frequency: every 39.1 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /463,332 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.07MB] [CPU: ▼5.51ms] Passed 4 tests

Analyzing server-side resources used by BestWebSoft's Twitter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.86 ▼4.38
Dashboard /wp-admin3.37 ▲0.0748.36 ▲1.74
Posts /wp-admin/edit.php3.48 ▲0.1359.53 ▲12.49
Add New Post /wp-admin/post-new.php5.97 ▲0.0880.29 ▼20.27
Media Library /wp-admin/upload.php3.29 ▲0.0634.65 ▲0.89

Server storage [IO: ▲5.28MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 128 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
twttr_options
db_upgraded
widget_recent-comments
theysaidso_admin_options
bstwbsftwppdtplgns_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for BestWebSoft's Twitter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14914.36 ▼0.191.63 ▲0.0639.19 ▼1.37
Dashboard /wp-admin2,308 ▲1375.59 ▲0.0188.00 ▲1.3740.43 ▼1.71
Posts /wp-admin/edit.php2,229 ▲1292.23 ▲0.2437.58 ▼0.1933.62 ▼2.54
Add New Post /wp-admin/post-new.php1,648 ▲12023.32 ▲0.36596.47 ▼74.3564.71 ▲12.43
Media Library /wp-admin/upload.php1,519 ▲1194.23 ▲0.0297.69 ▼10.7642.95 ▼2.50
BWS Panel /wp-admin/twitter.php?page=twttr-bws-panel260.420.0917.98
Settings /wp-admin/twitter.php260.420.085.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/twitter-plugin/bws_menu/product_list.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/twitter-plugin/includes/class-twttr-settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/twitter-plugin/twitter.php:572
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twitter-plugin/bws_menu/class-bws-settings.php:1501

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/twitter.php?page=twttr-bws-panel
    • > Network (severe)
    wp-admin/twitter.php?page=twttr-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/twitter.php
    • > Network (severe)
    wp-admin/twitter.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (Twitter buttons in the front-end.), #2 (Custom Twitter "Follow" button in the front-end.), #3 (Twitter Button Settings page.), #4 (Pasting Twitter shortcode into the content.)
You can take inspiration from this readme.txt

twitter-plugin/twitter.php 92% from 13 tests

Analyzing the main PHP file in "BestWebSoft's Twitter" version 2.64
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("twitter-plugin.php" instead of "twitter.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
There were no executable files found in this plugin20,131 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PO File124,1856,5078,492
CSS101902775,561
PHP94786395,349
JavaScript731112579
SVG400150

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity105.67
▷ Minimum class complexity21.00
▷ Maximum class complexity225.00
Average method complexity11.83
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2275.86%
▷ Protected methods00.00%
▷ Private methods724.14%
Functions70
▷ Named functions70100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
68 PNG files occupy 3.57MB with 1.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
bws_menu/icons/themes/realestate.png280.34KB108.34KB▼ 61.35%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.21KB▼ 34.34%
images/pro_screen_1.png22.67KB7.50KB▼ 66.90%