10% twitwi

Code Review | Twitwi

WordPress plugin Twitwi scored 10% from 54 tests.

About plugin

  • Plugin page: twitwi
  • Plugin version: 1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.6.1
  • WordPress version: 5.8.1
  • First release: Dec 29, 2013
  • Latest release: Oct 18, 2016
  • Number of updates: 9
  • Update frequency: every 113.8 days
  • Top authors: xuxu.fr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 770 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/twitwi/widgets/connect.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Twitwi_Connect has a deprecated constructor

Server metrics [RAM: ▼1.79MB] [CPU: ▼192.82ms] Passed 4 tests

A check of server-side resources used by Twitwi
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.84 ▼0.886.53 ▼14.42
Dashboard /wp-admin1.86 ▼1.206.66 ▼40.00
Posts /wp-admin/edit.php1.86 ▼1.256.54 ▼41.11
Add New Post /wp-admin/post-new.php1.86 ▼3.586.30 ▼664.14
Media Library /wp-admin/upload.php1.86 ▼1.156.21 ▼26.01
Twitwi /wp-admin/options-general.php?page=twitwi-page-options1.866.51

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 45 new files
Database: no new tables, 8 new options
New WordPress options
twitwi_role_default
twitwi_logout_redirect
twitwi_domain_mail_default
twitwi_register_notif
widget_wp_twitwi_connect
twitwi_logged_redirect
twitwi_include_entities
twitwi_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Twitwi
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,824 ▲22816.27 ▲0.2417.73 ▲7.5552.79 ▲4.42
Dashboard /wp-admin2,979 ▲425.95 ▲0.00155.02 ▲7.08112.55 ▲1.65
Posts /wp-admin/edit.php2,748 ▲92.71 ▲0.0076.42 ▲5.9292.31 ▲4.02
Add New Post /wp-admin/post-new.php1,622 ▼6121.39 ▲2.60303.86 ▼88.30107.89 ▼1.96
Media Library /wp-admin/upload.php1,819 ▲95.06 ▲0.03163.19 ▲6.99112.82 ▼2.52
Twitwi /wp-admin/options-general.php?page=twitwi-page-options1,2862.3758.8391.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/twitwi/widgets/connect.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Twitwi_Connect has a deprecated constructor

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=twitwi-page-options
    • > Deprecated in wp-content/plugins/twitwi/widgets/connect.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Twitwi_Connect has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=twitwi-page-options
    • > Deprecated in wp-content/plugins/twitwi/twitwi.php+40
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=twitwi-page-options
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in WP_Twitwi_Connect is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/twitwi/inc/twitteroauth/tests/Util/JsonDecoderTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/twitwi/inc/twitteroauth/tests/ConsumerTest.php:7
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/twitwi/template/connected.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/twitwi/inc/twitteroauth/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/twitwi/template/connected.php on line 12
    • > PHP Warning
      require_once(wp-content/plugins/twitwi/twitwi/library/includes/compat.php): failed to open stream: No such file or directory in wp-content/plugins/twitwi/twitwi.php on line 31
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/twitwi/template/connect.php on line 11
    • > PHP Warning
      require(wp-content/plugins/twitwi/inc/twitteroauth/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/twitwi/inc/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/twitwi/inc/twitteroauth/tests/AbstractSignatureMethodTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/twitwi/inc/twitteroauth/tests/TokenTest.php:7
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/twitwi/inc/twitteroauth/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/twitwi/template/connected.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
6 plugin tags: twitter, connect, avatar, user, api...

twitwi/twitwi.php Passed 13 tests

The main PHP file in "Twitwi" ver. 1.11 adds more information about the plugin and also serves as the entry point for this plugin
45 characters long description:
Twitwi, Another Twitter Connect for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,758 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP272947481,526
PO File1313285
JavaScript281736
JSON10034
Markdown27025
XML22123
CSS241219
YAML10010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.22
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes18
▷ Abstract classes211.11%
▷ Concrete classes1688.89%
▷ Final classes00.00%
Methods108
▷ Static methods76.48%
▷ Public methods9587.96%
▷ Protected methods54.63%
▷ Private methods87.41%
Functions27
▷ Named functions2592.59%
▷ Anonymous functions27.41%
Constants14
▷ Global constants1071.43%
▷ Class constants428.57%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected