62% custom-twitter-feeds

Code Review | Custom Twitter Feeds - A Tweets Widget or X Feed Widget

WordPress plugin Custom Twitter Feeds - A Tweets Widget or X Feed Widget scored62%from 54 tests.

About plugin

  • Plugin page: custom-twitter-feeds
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: May 10, 2016
  • Latest release: Nov 7, 2023
  • Number of updates: 184
  • Update frequency: every 14.9 days
  • Top authors: smashballoon (84.24%)Craig at Smash Balloon (16.3%)

Code review

54 tests

User reviews

379 reviews

Install metrics

100,000+ active /2,130,389 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.73MB] [CPU: ▲10.33ms] Passed 4 tests

Server-side resources used by Custom Twitter Feeds - A Tweets Widget or X Feed Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.38 ▲1.9255.36 ▲14.37
Dashboard /wp-admin6.36 ▲3.0160.63 ▼6.04
Posts /wp-admin/edit.php6.41 ▲3.0560.76 ▲13.60
Add New Post /wp-admin/post-new.php8.90 ▲3.01114.69 ▲19.38
Media Library /wp-admin/upload.php6.22 ▲2.9955.96 ▲20.77
Settings /wp-admin/admin.php?page=ctf-settings6.9165.24
About Us /wp-admin/admin.php?page=ctf-about-us6.2250.01
YouTube Feed /wp-admin/admin.php?page=custom-twitter-feeds&tab=more6.1948.53
Twitter Feeds /wp-admin/admin.php?page=custom-twitter-feeds6.1947.36
All Feeds /wp-admin/admin.php?page=ctf-feed-builder8.74115.46
Support /wp-admin/admin.php?page=ctf-support6.1142.88

Server storage [IO: ▲4.36MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 271 new files
Database: 5 new tables, 11 new options
New tables
wp_ctf_feeds
wp_ctf_feeds_posts
wp_ctf_posts
wp_ctf_feed_locator
wp_ctf_feed_caches
New WordPress options
ctf_db_version
ctf_notifications
can_compress_scripts
db_upgraded
widget_custom-twitter-feeds-widget
widget_theysaidso_widget
widget_recent-posts
ctf_newuser_notifications
widget_recent-comments
ctf_version
...

Browser metrics Passed 4 tests

A check of browser resources used by Custom Twitter Feeds - A Tweets Widget or X Feed Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13413.29 ▼1.054.45 ▲2.53101.60 ▲55.75
Dashboard /wp-admin2,299 ▲1226.03 ▲0.3688.48 ▲0.3952.30 ▲11.03
Posts /wp-admin/edit.php2,208 ▲1082.33 ▲0.3942.97 ▲6.5047.62 ▲13.14
Add New Post /wp-admin/post-new.php6,276 ▲4,75019.19 ▼3.98974.68 ▲199.8638.95 ▼28.27
Media Library /wp-admin/upload.php1,494 ▲1004.56 ▲0.38102.80 ▲4.1353.71 ▲10.30
Settings /wp-admin/admin.php?page=ctf-settings3,4885.50110.37101.04
About Us /wp-admin/admin.php?page=ctf-about-us1,7903.2858.9337.81
YouTube Feed /wp-admin/admin.php?page=custom-twitter-feeds&tab=more8902.0530.3919.88
Twitter Feeds /wp-admin/admin.php?page=custom-twitter-feeds8902.0430.6318.54
All Feeds /wp-admin/admin.php?page=ctf-feed-builder5,7159.11157.9883.72
Support /wp-admin/admin.php?page=ctf-support1,8223.5660.6263.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_ctf_feeds_posts
    • wp_ctf_posts
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • widget_custom-twitter-feeds-widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • ctf_version
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ctf-support
    • > Notice in wp-content/plugins/custom-twitter-feeds/inc/Admin/CTF_Support.php+463
    Trying to access array offset on value of type bool

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
  • 51× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/empty-state.php
    • > /wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/popup/feedtypes-popup.php
    • > /wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/popup/onboarding-popup.php
    • > /wp-content/plugins/custom-twitter-feeds/inc/SB_Twitter_Cron_Updater.php
    • > /wp-content/plugins/custom-twitter-feeds/inc/CTF_Display_Elements.php
    • > /wp-content/plugins/custom-twitter-feeds/admin/builder/templates/screens/customizer.php
    • > /wp-content/plugins/custom-twitter-feeds/templates/error.php
    • > /wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/feeds/legacy-feeds.php
    • > /wp-content/plugins/custom-twitter-feeds/inc/CTF_Parse.php
    • > /wp-content/plugins/custom-twitter-feeds/admin/views/settings/tab/feeds.php
  • 73× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant CTF_BUILDER_DIR - assumed 'CTF_BUILDER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-twitter-feeds/admin/builder/templates/screens/customizer.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-upgrader-skin.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-twitter-feeds/inc/Admin/PluginSilentUpgraderSkin.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-twitter-feeds/inc/ctf-functions.php:221
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-twitter-feeds/inc/admin-hooks.php:2
    • > PHP Warning
      Use of undefined constant CTF_BUILDER_DIR - assumed 'CTF_BUILDER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/select-source.php on line 3
    • > PHP Warning
      include(CTF_BUILDER_DIRtemplates/sections/create-feed/multiple-sources-list.php): failed to open stream: No such file or directory in wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/popup/feedtypes-customizer-popup.php on line 9
    • > PHP Warning
      Use of undefined constant CTF_BUILDER_DIR - assumed 'CTF_BUILDER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/feeds-list.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'TwitterFeed\\CTF_Display_Elements' not found in wp-content/plugins/custom-twitter-feeds/templates/header-text.php:12
    • > PHP Warning
      Use of undefined constant CTF_BUILDER_DIR - assumed 'CTF_BUILDER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-twitter-feeds/admin/builder/templates/sections/feeds-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'TwitterFeed\\Builder\\CTF_Feed_Builder' not found in wp-content/plugins/custom-twitter-feeds/admin/views/sections/sticky_widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: You can take inspiration from this readme.txt

custom-twitter-feeds/custom-twitter-feed.php 92% from 13 tests

The main PHP file in "Custom Twitter Feeds - A Tweets Widget or X Feed Widget" ver. 2.2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-twitter-feeds.php" instead of "custom-twitter-feed.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin48,431 lines of code in 203 files:
LanguageFilesBlank linesComment linesLines of code
PHP1543,7305,83523,174
CSS141,11554819,887
JavaScript196889875,036
SVG1400183
HTML1283103
JSON10048

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 158)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity33.65
▷ Minimum class complexity1.00
▷ Maximum class complexity498.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity158.00
Code structure
Namespaces11
Interfaces0
Traits2
Classes84
▷ Abstract classes11.19%
▷ Concrete classes8398.81%
▷ Final classes00.00%
Methods717
▷ Static methods24033.47%
▷ Public methods67794.42%
▷ Protected methods152.09%
▷ Private methods253.49%
Functions87
▷ Named functions8698.85%
▷ Anonymous functions11.15%
Constants44
▷ Global constants2454.55%
▷ Class constants2045.45%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
50 PNG files occupy 0.32MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/about/plugin-smtp.png8.19KB8.45KB0.00%
admin/builder/assets/img/reviews.png1.90KB2.13KB0.00%
admin/builder/assets/img/dummy-author.png2.72KB1.78KB▼ 34.71%
admin/assets/img/book-icon.png3.20KB1.22KB▼ 61.94%
admin/builder/assets/img/timeline.png1.74KB1.86KB0.00%