10% sm2wp-google-minimal

Code Review | Social Media 2 WordPress for Google+

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

About plugin

  • Plugin page: sm2wp-google-minimal
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 13, 2014
  • Latest release: Sep 17, 2014
  • Number of updates: 17
  • Update frequency: every 0.4 days
  • Top authors: djtidau (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,384 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/sm2wp-google-minimal/classes/sm2wp_googleplus.php+5
    Constant WP_POST_REVISIONS already defined

Server metrics [RAM: ▼1.58MB] [CPU: ▼56.06ms] Passed 4 tests

A check of server-side resources used by Social Media 2 WordPress for Google+
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1741.13 ▼10.34
Dashboard /wp-admin2.37 ▼0.978.87 ▼58.27
Posts /wp-admin/edit.php2.38 ▼0.997.10 ▼42.43
Add New Post /wp-admin/post-new.php2.37 ▼3.526.64 ▼96.22
Media Library /wp-admin/upload.php2.37 ▼0.867.19 ▼27.33
SM2WP / Google+ /wp-admin/options-general.php?page=sm2wp-googleplus2.387.85

Server storage [IO: ▲0.06MB] [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: 7 new files
Database: no new tables, 9 new options
New WordPress options
gfw_info
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
gfw_schedule
widget_recent-posts
gfw_errors
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Social Media 2 WordPress for Google+
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,783 ▲3714.24 ▼0.111.66 ▲0.0740.22 ▲1.19
Dashboard /wp-admin2,199 ▲185.64 ▼0.0985.08 ▼31.3537.65 ▼6.75
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0237.65 ▲3.1336.29 ▼0.85
Add New Post /wp-admin/post-new.php1,527 ▼123.17 ▲0.19675.70 ▲8.2358.72 ▲5.81
Media Library /wp-admin/upload.php1,401 ▼24.10 ▼0.08112.18 ▲6.8946.73 ▲2.78
SM2WP / Google+ /wp-admin/options-general.php?page=sm2wp-googleplus1,4951.7827.0546.36

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
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/sm2wp-google-minimal/classes/sm2wp_googleplus_admin.php+3
    Constant WP_POST_REVISIONS already defined
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • gfw_info
    • db_upgraded
    • gfw_errors
    • widget_theysaidso_widget
    • can_compress_scripts
    • gfw_schedule

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=sm2wp-googleplus
    • > Notice in wp-content/plugins/sm2wp-google-minimal/classes/sm2wp_googleplus_admin.php+3
    Constant WP_POST_REVISIONS already defined

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
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/sm2wp-google-minimal/classes/google_plus.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sm2wp-google-minimal/classes/sm2wp_googleplus.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/sm2wp-google-minimal/classes/google_plus.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/sm2wp-google-minimal/views/admin.php:96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sm2wp-google-minimal/classes/common.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sm2wp-google-minimal/classes/google_plus.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: blog, import, seo, social, google...

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

This is the main PHP file of "Social Media 2 WordPress for Google+" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sm2wp-google-minimal.php" instead of "sm2wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,246 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6223191,246

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity22.00
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes228.57%
▷ Concrete classes571.43%
▷ Final classes00.00%
Methods53
▷ Static methods1528.30%
▷ Public methods4381.13%
▷ Protected methods59.43%
▷ Private methods59.43%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected