83% twitter

Code Review | Twitter

WordPress plugin Twitter scored83%from 54 tests.

About plugin

  • Plugin page: twitter
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2
  • WordPress version: 6.3.1
  • First release: Jan 5, 2009
  • Latest release: Jul 25, 2019
  • Number of updates: 75
  • Update frequency: every 51.4 days
  • Top authors: niallkennedy (42.67%)Twitter (29.33%)V.J.Catkick (28%)Otto42 (4%)

Code review

54 tests

User reviews

32 reviews

Install metrics

10,000+ active /692,796 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.97MB] [CPU: ▲5.68ms] Passed 4 tests

This is a short check of server-side resources used by Twitter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.56 ▲1.1055.25 ▲10.77
Dashboard /wp-admin4.24 ▲0.9457.19 ▼4.71
Posts /wp-admin/edit.php4.35 ▲1.0062.26 ▲8.88
Add New Post /wp-admin/post-new.php6.91 ▲1.03107.72 ▲10.14
Media Library /wp-admin/upload.php4.16 ▲0.9345.91 ▲8.42

Server storage [IO: ▲0.52MB] [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: 104 new files
Database: no new tables, 13 new options
New WordPress options
widget_twitter-tracking
theysaidso_admin_options
widget_periscope-on-air
widget_twitter-follow
widget_twitter-timeline-list
db_upgraded
widget_twitter-timeline-search
can_compress_scripts
widget_twitter-timeline-profile
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Twitter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7613.33 ▼1.351.90 ▼0.0843.11 ▼4.07
Dashboard /wp-admin2,219 ▲314.85 ▼0.09105.20 ▼0.7140.63 ▼0.78
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0041.06 ▲3.7135.35 ▼2.21
Add New Post /wp-admin/post-new.php1,617 ▲8922.97 ▼0.16664.45 ▼3.8772.90 ▲11.60
Media Library /wp-admin/upload.php1,407 ▲194.27 ▼0.0096.86 ▼5.7644.40 ▼0.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • db_upgraded
    • widget_twitter-collection
    • can_compress_scripts
    • widget_twitter-timeline-list
    • widget_twitter-timeline-search
    • widget_twitter-timeline-profile
    • widget_recent-comments
    • widget_periscope-on-air
    • theysaidso_admin_options
    • widget_recent-posts
    • ...

Smoke tests 75% 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 50% 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 take a closer look at the following
  • 48× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Trait 'Twitter\\Intents\\Traits\\Related' not found in wp-content/plugins/twitter/src/Twitter/Intents/Tweet.php on line 35
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Widgets\\Embeds\\Timeline' not found in wp-content/plugins/twitter/src/Twitter/Widgets/Embeds/Timeline/Search.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Widgets\\Embeds\\Timeline\\Collection' not found in wp-content/plugins/twitter/src/Twitter/Widgets/Embeds/Moment.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\WordPress\\Widgets\\Embeds\\Timeline' not found in wp-content/plugins/twitter/src/Twitter/WordPress/Widgets/Embeds/Timeline/Profile.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Widgets\\Base' not found in wp-content/plugins/twitter/src/Twitter/Widgets/Embeds/Timeline.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\WordPress\\Widgets\\Widget' not found in wp-content/plugins/twitter/src/Twitter/WordPress/Widgets/Buttons/Follow.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Cards\\Summary' not found in wp-content/plugins/twitter/src/Twitter/Cards/SummaryLargeImage.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'Twitter\\WordPress\\Admin\\Settings\\SettingsSection' not found in wp-content/plugins/twitter/src/Twitter/WordPress/Admin/Settings/Cards/SiteAttribution.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Widgets\\Base' not found in wp-content/plugins/twitter/src/Twitter/Widgets/Buttons/Periscope/OnAir.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twitter\\Widgets\\Embeds\\Timeline' not found in wp-content/plugins/twitter/src/Twitter/Widgets/Embeds/Timeline/Collection.php:33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === twitter === )
  • Tags: You are using too many tags: 13 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Settings screen. Customize Tweet and Timeline color schemes including background, text colors, and borders. Attribute site content to a Twitter account. Automatically include Tweet buttons alongside your post content.) image required
You can take inspiration from this readme.txt

twitter/twitter.php Passed 13 tests

The primary PHP file in "Twitter" version 2.0.5 is used by WordPress to initiate all plugin functionality
124 characters long description:
Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.6 or greater.

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
Good job! No executable or dangerous file extensions detected7,387 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP1002,1719,3617,356
JSON10030
CSS1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity14.15
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces40
Interfaces4
Traits8
Classes84
▷ Abstract classes67.14%
▷ Concrete classes7892.86%
▷ Final classes00.00%
Methods502
▷ Static methods29057.77%
▷ Public methods48797.01%
▷ Protected methods152.99%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants158
▷ Global constants00.00%
▷ Class constants158100.00%
▷ Public constants158100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin