83% dsgnwrks-twitter-importer

Code Review | DsgnWrks Twitter Importer

WordPress plugin DsgnWrks Twitter Importerscored83%from 54 tests.

About plugin

  • Plugin page: dsgnwrks-twitter-...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2012
  • Latest release: Jul 25, 2019
  • Number of updates: 27
  • Update frequency: every 93.6 days
  • Top authors: jtsternberg (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▲0.31ms] Passed 4 tests

Server-side resources used by DsgnWrks Twitter Importer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1739.13 ▼0.29
Dashboard /wp-admin3.48 ▲0.1749.16 ▼1.40
Posts /wp-admin/edit.php3.59 ▲0.2456.12 ▲8.42
Add New Post /wp-admin/post-new.php6.06 ▲0.1796.49 ▼1.61
Media Library /wp-admin/upload.php3.40 ▲0.1739.85 ▲4.55
Twitter Importer /wp-admin/tools.php?page=dw-twitter-importer-settings3.6135.21

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by DsgnWrks Twitter Importer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.35 ▼1.022.05 ▲0.2144.60 ▲1.35
Dashboard /wp-admin2,213 ▲284.85 ▼1.01109.37 ▼5.2142.01 ▼0.58
Posts /wp-admin/edit.php2,093 ▲12.00 ▼0.0339.34 ▼0.0035.60 ▼1.79
Add New Post /wp-admin/post-new.php1,536 ▲1623.22 ▲0.15672.44 ▲28.3952.91 ▼15.40
Media Library /wp-admin/upload.php1,386 ▼54.21 ▼0.0298.55 ▼9.4744.16 ▼1.49
Twitter Importer /wp-admin/tools.php?page=dw-twitter-importer-settings8481.8428.7334.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required '_DWTW_PATHTwitterText/lib/Twitter/Autolink.php' (include_path='.:/usr/share/php') in wp-content/plugins/dsgnwrks-twitter-importer/DW_Twitter_Autolink.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dsgnwrks-twitter-importer/dsgnwrks-twitter-importer.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dsgnwrks-twitter-importer/TwitterWP/example.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/dsgnwrks-twitter-importer/settings.php:2
    • > PHP Warning
      Use of undefined constant _DWTW_PATH - assumed '_DWTW_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dsgnwrks-twitter-importer/DW_Twitter_Autolink.php on line 10
    • > PHP Warning
      require_once(_DWTW_PATHTwitterText/lib/Twitter/Autolink.php): failed to open stream: No such file or directory in wp-content/plugins/dsgnwrks-twitter-importer/DW_Twitter_Autolink.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === DsgnWrks Twitter Importer=== )
  • Screenshots: These screenshots do not have images: #1 (Welcome Panel.), #2 (After adding a user, this is the options panel you'll be presented with. If you select a custom post-type in the post-type selector, the options may change based on the post-type's supports, as well as any custom taxonomies.)
The official readme.txt is a good inspiration

dsgnwrks-twitter-importer/dsgnwrks-twitter-importer.php 92% from 13 tests

The entry point to "DsgnWrks Twitter Importer" version 1.1.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 183 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,009 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP94561,0231,673
Markdown2580169
CSS171104
JavaScript124663

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity34.29
▷ Minimum class complexity3.00
▷ Maximum class complexity104.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods106
▷ Static methods1211.32%
▷ Public methods7368.87%
▷ Protected methods3230.19%
▷ Private methods10.94%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants214.29%
▷ Class constants1285.71%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/social.png29.96KB9.98KB▼ 66.70%