78% ot-twitter-feed

Code Review | Twitter Feed

WordPress plugin Twitter Feed scored78%from 54 tests.

About plugin

  • Plugin page: ot-twitter-feed
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Aug 31, 2017
  • Latest release: Apr 19, 2018
  • Number of updates: 10
  • Update frequency: every 23.2 days
  • Top authors: caselock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,709 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.12ms] Passed 4 tests

This is a short check of server-side resources used by Twitter Feed
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0442.19 ▼0.40
Dashboard /wp-admin3.36 ▲0.0146.08 ▼14.09
Posts /wp-admin/edit.php3.41 ▲0.0547.59 ▼4.47
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.33 ▼9.53
Media Library /wp-admin/upload.php3.28 ▲0.0536.51 ▲2.18
OT Twitter Feed /wp-admin/options-general.php?page=ottwitter3.2531.66

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
recovery_mode_email_last_sent
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Twitter Feed
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.22 ▼1.181.78 ▲0.0143.44 ▼1.94
Dashboard /wp-admin2,212 ▲244.82 ▼1.08107.99 ▼0.2241.98 ▲2.79
Posts /wp-admin/edit.php2,095 ▲62.06 ▼0.0039.39 ▼0.9335.14 ▼1.05
Add New Post /wp-admin/post-new.php1,522 ▲317.80 ▼5.64626.62 ▲11.6848.50 ▼15.81
Media Library /wp-admin/upload.php1,394 ▲154.27 ▲0.0695.08 ▼7.2544.33 ▲0.30
OT Twitter Feed /wp-admin/options-general.php?page=ottwitter7391.147.0121.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=ottwitter
    • > Notice in wp-content/plugins/ot-twitter-feed/functions.php+28
    Undefined index: ottwitter_animate
    • > GET request to /wp-admin/options-general.php?page=ottwitter
    • > Error in wp-content/plugins/ot-twitter-feed/functions.php+31
    Uncaught Error: Call to undefined function otfbmsg_e() in wp-content/plugins/ot-twitter-feed/functions.php:31
    Stack trace:
    #0 wp-admin/includes/template.php(1824): ottwitter_animate_callback()
    #1 wp-admin/includes/template.php(1778): do_settings_fields()
    #2 wp-content/plugins/ot-twitter-feed/ottwitterfeed-setting.php(33): do_settings_sections()
    #3 wp-content/plugins/ot-twitter-feed/ottwitterfeed.php(63): include_once('/var/www/wordpr...')
    #4 wp-includes/class-wp-hook.php(310): ottwitter_setting()
    #5 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(517): WP_Hook->do_action()
    #7 wp-admin/admin.php(259): do_action()
    #8 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #9 {main}
    thrown

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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/ot-twitter-feed/ottwitterfeed-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ot-twitter-feed/ottwitterfeed-shortcode.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ot-twitter-feed/functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ot-twitter-feed/ottwitterfeed.php:14

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: twitter, twitter feed, twitter feed slide

ot-twitter-feed/ottwitterfeed.php 85% from 13 tests

The primary PHP file in "Twitter Feed" version 1.3.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ot-twitter-feed.php" instead of "ottwitterfeed.php")
  • Description: The description should be shorter than 140 characters (currently 181 characters long)

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
Everything looks great! No dangerous files found in this plugin1,095 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
CSS42020569
SVG100288
PHP43320236
JavaScript1052

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/twitter.png4.17KB1.57KB▼ 62.34%
assets/images/icon.png3.25KB0.66KB▼ 79.78%
assets/images/powered_icon.png1.43KB0.45KB▼ 68.87%