68% wp-twitteranalytics

Code Review | WP-TwitterAnalytics

WordPress plugin WP-TwitterAnalytics scored68%from 54 tests.

About plugin

  • Plugin page: wp-twitteranalytics
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.3.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2012
  • Latest release: Apr 8, 2012
  • Number of updates: 22
  • Update frequency: every 0.3 days
  • Top authors: sgarenson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,039 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.74ms] Passed 4 tests

An overview of server-side resources used by WP-TwitterAnalytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.83 ▲0.37
Dashboard /wp-admin3.34 ▲0.0050.18 ▼12.07
Posts /wp-admin/edit.php3.40 ▲0.0448.06 ▲0.21
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.37 ▼11.47
Media Library /wp-admin/upload.php3.27 ▲0.0444.02 ▲9.60

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 59 new files
Database: 2 new tables, 7 new options
New tables
wp_im_tweets
wp_im_query
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
InsightMetrix_db_version
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WP-TwitterAnalytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.59 ▲0.311.70 ▲0.1744.57 ▲5.95
Dashboard /wp-admin2,210 ▲335.56 ▼0.0094.41 ▲9.0982.12 ▲44.05
Posts /wp-admin/edit.php2,115 ▲151.97 ▲0.0034.42 ▼0.7232.13 ▼4.23
Add New Post /wp-admin/post-new.php1,693 ▲16521.96 ▼1.39668.14 ▼20.5050.88 ▼3.55
Media Library /wp-admin/upload.php1,409 ▲154.20 ▼0.0297.52 ▼4.1984.23 ▲38.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_im_tweets
    • wp_im_query
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • InsightMetrix_db_version
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-twitteranalytics/flexigrid/FlexiGrid.php
    • > /wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php
    • > /wp-content/plugins/wp-twitteranalytics/js/InsightMetrix-js.php
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-twitteranalytics/includes/DeleteControl.php:20
    • > PHP Warning
      Use of undefined constant INSIGHT_METRIX_API_URL - assumed 'INSIGHT_METRIX_API_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php on line 3
    • > PHP Notice
      Undefined variable: im_chartSettings in wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-twitteranalytics/chart/chart.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/wp-twitteranalytics/api/data.php:42
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-twitteranalytics/chart/ChartControls.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-twitteranalytics/InsightMetrix.php:10
    • > PHP Warning
      Use of undefined constant INSIGHT_METRIX_API_URL - assumed 'INSIGHT_METRIX_API_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-twitteranalytics/flexigrid/FlexiGrid.php on line 42

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: analytics, social analytics, twitter

wp-twitteranalytics/InsightMetrix.php 92% from 13 tests

"WP-TwitterAnalytics" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-twitteranalytics.php" instead of "InsightMetrix.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected3,362 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5241631,586
PHP101441051,020
CSS21306756

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods133.33%
▷ Protected methods00.00%
▷ Private methods266.67%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
24 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/control-delete.png0.77KB0.91KB0.00%
images/icon32.png2.26KB1.52KB▼ 32.70%
images/control-play.png0.41KB0.39KB▼ 4.34%
images/control-record.png0.51KB0.53KB0.00%
flexigrid/css/images/hl.png0.18KB0.15KB▼ 16.40%