10% display-tweets-php

Code Review | Display Tweets

WordPress plugin Display Tweets scored 10% 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: 5.8.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

3,000+ active / 49,066 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/display-tweets-php/displaytweets.php+627
    Function create_function() is deprecated

Server metrics [RAM: ▼1.74MB] [CPU: ▼183.61ms] Passed 4 tests

An overview of server-side resources used by Display Tweets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.89 ▼0.945.13 ▼19.79
Dashboard /wp-admin1.91 ▼1.155.29 ▼40.97
Posts /wp-admin/edit.php1.91 ▼1.205.60 ▼28.17
Add New Post /wp-admin/post-new.php1.91 ▼3.5310.30 ▼645.03
Media Library /wp-admin/upload.php1.91 ▼1.094.37 ▼20.25
Twitter Feed /wp-admin/options-general.php?page=displaytweets1.915.68

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 3 new options
New WordPress options
displaytweets_settings
widget_displaytweetswidget
displaytweets_version

Browser metrics Passed 4 tests

Checking browser requirements for Display Tweets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,671 ▲7016.03 ▲0.365.44 ▼1.7879.06 ▲2.43
Dashboard /wp-admin2,935 ▲396.02 ▼0.18114.42 ▼17.51167.44 ▼6.69
Posts /wp-admin/edit.php2,742 ▲23.22 ▼0.0163.11 ▲0.56134.13 ▼6.69
Add New Post /wp-admin/post-new.php3,701 ▼10618.32 ▼0.19408.09 ▼15.57159.94 ▼28.76
Media Library /wp-admin/upload.php1,757 ▲85.54 ▼0.02147.89 ▼0.53183.30 ▲0.18
Twitter Feed /wp-admin/options-general.php?page=displaytweets1,3812.4955.34112.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/display-tweets-php/displaytweets.php+627
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_displaytweetswidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | 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
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/callback.php
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/clearsessions.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
    • > /wp-content/plugins/display-tweets-php/includes/Twitter/connect.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/display-tweets-php/displaytweets.php:90
    • > 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/twitteroauth/twitteroauth.php on line 118
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/display-tweets-php/includes/Twitter/index.php on line 20
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/display-tweets-php/includes/Twitter/index.php on line 17
    • > PHP Notice
      Undefined index: oauth_verifier in wp-content/plugins/display-tweets-php/includes/Twitter/callback.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/display-tweets-php/includes/Twitter/index.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 118
    • > 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_token_secret in wp-content/plugins/display-tweets-php/includes/Twitter/twitteroauth/twitteroauth.php on line 82

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 96% from 29 tests

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

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

The principal PHP file in "Display Tweets" v. 1.0.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main 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
There were no executable files found in this plugin1,285 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP114006971,285

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
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%