10% dw-twitter-base

Code Review | Twitter Base

WordPress plugin Twitter Base scored10%from 54 tests.

About plugin

  • Plugin page: dw-twitter-base
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Mar 15, 2015
  • Latest release: Jan 28, 2016
  • Number of updates: 113
  • Update frequency: every 2.8 days
  • Top authors: simone.marchese (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,390 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
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/dw-twitter-base/include/widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; DwTwWidget has a deprecated constructor

Server metrics [RAM: ▼1.68MB] [CPU: ▼58.14ms] Passed 4 tests

A check of server-side resources used by Twitter Base
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.147.24 ▼39.38
Dashboard /wp-admin2.34 ▼1.0110.19 ▼53.56
Posts /wp-admin/edit.php2.34 ▼1.028.49 ▼44.24
Add New Post /wp-admin/post-new.php2.34 ▼3.559.04 ▼95.36
Media Library /wp-admin/upload.php2.34 ▼0.898.27 ▼33.14
Twitter Base /wp-admin/options-general.php?page=my-unique-identifier2.3413.22

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 12 new options
New WordPress options
dw_consumersecret
can_compress_scripts
dw_accesstoken
widget_theysaidso_widget
dw_consumerkey
theysaidso_admin_options
dw_twitteruser
dw_accesstokensecret
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Twitter Base
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.31 ▼0.052.00 ▲0.3443.90 ▲3.08
Dashboard /wp-admin2,203 ▲255.66 ▲0.0595.25 ▼8.4942.93 ▼2.84
Posts /wp-admin/edit.php2,108 ▲52.01 ▲0.0133.88 ▼4.8439.59 ▲3.19
Add New Post /wp-admin/post-new.php1,533 ▲523.24 ▲0.12605.92 ▼71.4153.09 ▼9.89
Media Library /wp-admin/upload.php1,405 ▲54.25 ▲0.03100.05 ▼15.1745.07 ▼3.74
Twitter Base /wp-admin/options-general.php?page=my-unique-identifier1,0522.3224.9434.16

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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/dw-twitter-base/include/widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; DwTwWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 12 options in the database
    • widget_dwtwwidget
    • db_upgraded
    • can_compress_scripts
    • dw_twitteruser
    • widget_theysaidso_widget
    • dw_accesstokensecret
    • dw_consumersecret
    • dw_consumerkey
    • widget_recent-comments
    • dw_accesstoken
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=my-unique-identifier
    • > Deprecated in wp-content/plugins/dw-twitter-base/include/widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; DwTwWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my-unique-identifier
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/options-general.php?page=my-unique-identifier
    • > Notice in wp-content/plugins/dw-twitter-base/twitter-base.php+289
    Undefined variable: help_tabs
    • > GET request to /wp-admin/options-general.php?page=my-unique-identifier
    • > Warning in wp-content/plugins/dw-twitter-base/twitter-base.php+289
    count(): Parameter must be an array or an object that implements Countable

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
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dw-twitter-base/include/shortcode.php
    • > /wp-content/plugins/dw-twitter-base/twitter-base.php
    • > /wp-content/plugins/dw-twitter-base/include/widget.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'config.php' (include_path='.:/usr/share/php') in wp-content/plugins/dw-twitter-base/lib/callback.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'config.php' (include_path='.:/usr/share/php') in wp-content/plugins/dw-twitter-base/lib/redirect.php on line 6
    • > PHP Warning
      require_once(config.php): failed to open stream: No such file or directory in wp-content/plugins/dw-twitter-base/lib/redirect.php on line 6
    • > PHP Warning
      require_once(config.php): failed to open stream: No such file or directory in wp-content/plugins/dw-twitter-base/lib/index.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'config.php' (include_path='.:/usr/share/php') in wp-content/plugins/dw-twitter-base/lib/index.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'config.php' (include_path='.:/usr/share/php') in wp-content/plugins/dw-twitter-base/lib/connect.php on line 11
    • > PHP Warning
      require_once(config.php): failed to open stream: No such file or directory in wp-content/plugins/dw-twitter-base/lib/connect.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'config.php' (include_path='.:/usr/share/php') in wp-content/plugins/dw-twitter-base/lib/connect.php on line 11
    • > PHP Warning
      require_once(config.php): failed to open stream: No such file or directory in wp-content/plugins/dw-twitter-base/lib/callback.php on line 11
    • > PHP Warning
      require_once(config.php): failed to open stream: No such file or directory in wp-content/plugins/dw-twitter-base/lib/connect.php on line 11

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 Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: mo, widget, shortcode, plugin, twitter...

dw-twitter-base/twitter-base.php 85% from 13 tests

"Twitter Base" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dw-twitter-base.php" instead of "twitter-base.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,500 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP133154381,153
PO File250110146
CSS3221106
Markdown137078
JavaScript15417

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity8.31
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods80
▷ Static methods1012.50%
▷ Public methods6986.25%
▷ Protected methods22.50%
▷ Private methods911.25%
Functions17
▷ Named functions1482.35%
▷ Anonymous functions317.65%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/twitter-share.png0.68KB0.68KB0.00%
css/twitter_button.png1.07KB0.78KB▼ 26.94%
img/google_support.png0.74KB0.66KB▼ 11.24%
img/linkedin_support.png0.39KB0.38KB▼ 3.97%