10% display-tweets-php

Code Review | Display Tweets

WordPress plugin Display Tweets scored10%from 54 tests.

About plugin

  • Plugin page: display-tweets-php
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.6
  • WordPress version: 6.3.1
  • First release: Apr 7, 2013
  • Latest release: Jun 21, 2013
  • Number of updates: 53
  • Update frequency: every 1.4 days
  • Top authors: MatthewRuddy (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

2,000+ active /49,673 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/display-tweets-php/displaytweets.php+627
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼62.11ms] Passed 4 tests

Server-side resources used by Display Tweets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.07 ▼36.78
Dashboard /wp-admin2.05 ▼1.267.56 ▼70.45
Posts /wp-admin/edit.php2.05 ▼1.316.70 ▼45.17
Add New Post /wp-admin/post-new.php2.05 ▼3.847.06 ▼96.05
Media Library /wp-admin/upload.php2.05 ▼1.186.49 ▼29.52
Twitter Feed /wp-admin/options-general.php?page=displaytweets2.056.36

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
displaytweets_settings
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
displaytweets_version
widget_displaytweetswidget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Display Tweets
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.441.51 ▼0.1438.25 ▼5.60
Dashboard /wp-admin2,193 ▲165.61 ▼0.0489.58 ▼2.1242.65 ▲0.07
Posts /wp-admin/edit.php2,107 ▲72.02 ▼0.0138.98 ▼3.5935.69 ▼4.33
Add New Post /wp-admin/post-new.php1,531 ▲423.12 ▼0.12624.28 ▼45.4858.91 ▼3.40
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.07104.38 ▼3.1043.49 ▼3.51
Twitter Feed /wp-admin/options-general.php?page=displaytweets9962.1425.2627.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/display-tweets-php/displaytweets.php+627
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_displaytweetswidget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=displaytweets
    • > Deprecated in wp-content/plugins/display-tweets-php/displaytweets.php+627
    Function create_function() is deprecated

SRP 0% 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 fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/connect.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/clearsessions.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/callback.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/index.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/redirect.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/test.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/display-tweets-php/includes/Twitter/twitteroauth/twitteroauth.php on line 118
    • > PHP Notice
      Undefined index: oauth_token_secret in wp-content/plugins/display-tweets-php/includes/Twitter/redirect.php on line 16
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/display-tweets-php/includes/Twitter/redirect.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/display-tweets-php/includes/Twitter/test.php on line 20
    • > PHP Notice
      Undefined index: oauth_token_secret in wp-content/plugins/display-tweets-php/includes/Twitter/twitteroauth/twitteroauth.php on line 82
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/display-tweets-php/includes/Twitter/callback.php on line 20
    • > PHP Notice
      Trying to get property 'remaining_hits' of non-object in wp-content/plugins/display-tweets-php/includes/Twitter/test.php on line 24
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/display-tweets-php/includes/Twitter/twitteroauth/twitteroauth.php on line 82
    • > PHP Notice
      Undefined index: oauth_verifier in wp-content/plugins/display-tweets-php/includes/Twitter/callback.php on line 23
    • > PHP Notice
      Undefined index: oauth_token_secret in wp-content/plugins/display-tweets-php/includes/Twitter/twitteroauth/twitteroauth.php on line 118

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: feed, display, tweets, favourites, retweets...

display-tweets-php/displaytweets.php 92% from 13 tests

The main file in "Display Tweets" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("display-tweets-php.php" instead of "displaytweets.php")

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
Good job! No executable or dangerous file extensions detected1,285 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP114006971,285

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity9.07
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes214.29%
▷ Concrete classes1285.71%
▷ Final classes00.00%
Methods101
▷ Static methods1514.85%
▷ Public methods8988.12%
▷ Protected methods21.98%
▷ Private methods109.90%
Functions3
▷ Named functions3100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/Twitter/images/darker.png2.31KB1.70KB▼ 26.41%
includes/Twitter/images/lighter.png2.43KB1.77KB▼ 27.11%