10% sm2wp-twitter-minimal

Code Review | Social Media 2 WordPress for Twitter

WordPress plugin Social Media 2 WordPress for Twitter scored10%from 54 tests.

About plugin

  • Plugin page: sm2wp-twitter-min...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Oct 7, 2014
  • Latest release: Oct 10, 2014
  • Number of updates: 9
  • Update frequency: every 0.6 days
  • Top authors: djtidau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,945 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/sm2wp-twitter-minimal/sm2wp.php+17
    Constant WP_POST_REVISIONS already defined

Server metrics [RAM: ▼1.61MB] [CPU: ▼47.92ms] Passed 4 tests

A check of server-side resources used by Social Media 2 WordPress for Twitter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.38 ▼1.086.92 ▼30.09
Dashboard /wp-admin2.40 ▼0.907.28 ▼39.44
Posts /wp-admin/edit.php2.40 ▼0.968.31 ▼39.80
Add New Post /wp-admin/post-new.php2.40 ▼3.497.07 ▼82.36
Media Library /wp-admin/upload.php2.40 ▼0.837.69 ▼27.59
SM2WP / Twitter /wp-admin/options-general.php?page=sm2wp-twitter2.407.93

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
tfw_errors
widget_recent-posts
widget_theysaidso_widget
tfw_info
widget_recent-comments
theysaidso_admin_options
tfw_schedule
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Social Media 2 WordPress for Twitter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.51 ▲0.271.70 ▲0.0638.36 ▼7.93
Dashboard /wp-admin2,196 ▲215.57 ▼0.1481.06 ▼21.8543.43 ▲0.36
Posts /wp-admin/edit.php2,104 ▲72.03 ▲0.0733.90 ▼8.1033.29 ▼4.65
Add New Post /wp-admin/post-new.php1,531 ▲523.15 ▼0.07648.37 ▼33.8252.63 ▼1.99
Media Library /wp-admin/upload.php1,398 ▲14.12 ▼0.0794.51 ▼4.0342.94 ▼0.92
SM2WP / Twitter /wp-admin/options-general.php?page=sm2wp-twitter1,3681.7428.4941.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/sm2wp-twitter-minimal/sm2wp.php+69
    include_once(updater.php): failed to open stream: No such file or directory
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • tfw_errors
    • db_upgraded
    • tfw_info
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • tfw_schedule

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sm2wp-twitter
    • > Warning in wp-content/plugins/sm2wp-twitter-minimal/sm2wp.php+69
    include_once(updater.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=sm2wp-twitter
    • > Warning in wp-content/plugins/sm2wp-twitter-minimal/sm2wp.php+69
    include_once(): Failed opening 'updater.php' for inclusion (include_path='.:/usr/share/php')

SRP 50% 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sm2wp-twitter-minimal/admin.php:75

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

sm2wp-twitter-minimal/sm2wp.php 92% from 13 tests

The primary PHP file in "Social Media 2 WordPress for Twitter" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sm2wp-twitter-minimal.php" instead of "sm2wp.php")

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
Good job! No executable or dangerous file extensions detected975 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP218214975

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity29.50
▷ Minimum class complexity17.00
▷ Maximum class complexity42.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods1432.56%
▷ Public methods3376.74%
▷ Protected methods49.30%
▷ Private methods613.95%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin