68% widget-twitter

Code Review | WD WidgetTwitter

WordPress plugin WD WidgetTwitter scored68%from 54 tests.

About plugin

  • Plugin page: widget-twitter
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Mar 21, 2014
  • Latest release: Dec 16, 2019
  • Number of updates: 48
  • Update frequency: every 43.7 days
  • Top authors: webdorado (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /132,264 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.22ms] Passed 4 tests

A check of server-side resources used by WD WidgetTwitter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.83 ▼3.37
Dashboard /wp-admin3.36 ▲0.0642.53 ▼8.77
Posts /wp-admin/edit.php3.41 ▲0.0646.86 ▼3.21
Add New Post /wp-admin/post-new.php5.94 ▲0.0684.13 ▼9.52
Media Library /wp-admin/upload.php3.29 ▲0.0635.17 ▲1.43
Overview /wp-admin/admin.php?page=overview_wdti3.3033.80
Licensing /wp-admin/admin.php?page=licensing_twitter_integration3.2832.50
Uninstall /wp-admin/admin.php?page=uninstall_twitter_integration3.3131.96

Server storage [IO: ▲3.27MB] [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: 151 new files
Database: 1 new table, 10 new options
New tables
wp_twitter_integration
New WordPress options
theysaidso_admin_options
widget_recent-posts
wdti_admin_notice
wdti_do_activation_set_up_redirect
widget_recent-comments
db_upgraded
widget_twitter_integration
can_compress_scripts
WD_WDTI_VERSION_FREE
widget_theysaidso_widget

Browser metrics Passed 4 tests

WD WidgetTwitter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4313.66 ▼0.921.68 ▼0.3640.66 ▼3.60
Dashboard /wp-admin2,223 ▲325.86 ▲0.99108.19 ▼6.5168.64 ▲21.40
Posts /wp-admin/edit.php2,100 ▲322.02 ▼0.1234.86 ▼3.3329.65 ▼11.70
Add New Post /wp-admin/post-new.php1,527 ▼923.07 ▼0.25671.47 ▼7.86184.88 ▲136.36
Media Library /wp-admin/upload.php1,396 ▲114.10 ▼0.0999.42 ▼1.9476.33 ▲33.10
Overview /wp-admin/admin.php?page=overview_wdti1,3492.0426.6387.26
Licensing /wp-admin/admin.php?page=licensing_twitter_integration8212.0123.1521.82
Uninstall /wp-admin/admin.php?page=uninstall_twitter_integration9611.9229.0935.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_twitter_integration
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_twitter_integration
    • widget_recent-posts
    • WD_WDTI_VERSION_FREE
    • wdti_do_activation_set_up_redirect
    • theysaidso_admin_options
    • wdti_admin_notice
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 59× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'plugin_wd_url' of non-object in wp-content/plugins/widget-twitter/wd/templates/display_overview_welcome.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/widget-twitter/wd/templates/display_overview_user_guide.php:33
    • > PHP Notice
      Undefined variable: wd_options in wp-content/plugins/widget-twitter/wd/templates/display_subscribe.php on line 6
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/widget-twitter/wd/templates/display_overview.php on line 4
    • > PHP Notice
      Undefined variable: wd_options in wp-content/plugins/widget-twitter/wd/templates/display_subscribe.php on line 4
    • > PHP Notice
      Undefined variable: wd_options in wp-content/plugins/widget-twitter/wd/templates/display_overview.php on line 4
    • > PHP Notice
      Undefined variable: wd_options in wp-content/plugins/widget-twitter/wd/templates/display_overview_welcome.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/widget-twitter/wd/templates/display_overview_support.php:3
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-twitter/twitter.php on line 12
    • > PHP Notice
      Undefined variable: wd_options in wp-content/plugins/widget-twitter/wd/templates/display_overview_user_guide.php on line 30

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=uninstall_twitter_integration
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: wdReady is not defined" "ReferenceError: wdReady is not defined\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=uninstall_twitter_integration:218:6)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=uninstall_twitter_integration
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: wdReady is not defined

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
There were no plugin tags found

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

"WD WidgetTwitter" version 1.0.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("widget-twitter.php" instead of "twitter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin7,574 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP323335434,075
JavaScript61871532,008
CSS511371,373
Markdown1180112
HTML1106

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.70
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods116
▷ Static methods97.76%
▷ Public methods11599.14%
▷ Protected methods00.00%
▷ Private methods10.86%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants444.44%
▷ Class constants555.56%
▷ Public constants5100.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
98 PNG files occupy 2.87MB with 1.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wd/assets/img/cfm_main_plugin.png11.31KB5.72KB▼ 49.41%
images/user_prev.png102.96KB36.91KB▼ 64.15%
images/hashtagpreview.png3.99KB2.37KB▼ 40.58%
images/mention.png2.84KB1.44KB▼ 49.14%
wd/assets/img/faqwd_main_plugin.png18.26KB10.31KB▼ 43.54%