79% wp-github-sync

Code Review | WordPress GitHub Sync

WordPress plugin WordPress GitHub Sync scored79%from 54 tests.

About plugin

  • Plugin page: wp-github-sync
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.8
  • WordPress version: 6.3.1
  • First release: May 17, 2015
  • Latest release: Oct 9, 2017
  • Number of updates: 56
  • Update frequency: every 15.7 days
  • Top authors: JamesDiGioia (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /20,321 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by WordPress GitHub Sync
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.87 ▼0.30
Dashboard /wp-admin3.34 ▼0.0045.71 ▼16.27
Posts /wp-admin/edit.php3.46 ▲0.1044.60 ▼4.96
Add New Post /wp-admin/post-new.php5.93 ▲0.05116.08 ▲18.55
Media Library /wp-admin/upload.php3.27 ▲0.0437.42 ▲6.79
GitHub Sync /wp-admin/options-general.php?page=wp-github-sync3.2636.44

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 72 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 WordPress GitHub Sync
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲5814.38 ▲0.091.69 ▼0.0644.48 ▲5.17
Dashboard /wp-admin2,199 ▲185.61 ▼0.0688.90 ▼12.6837.86 ▼7.01
Posts /wp-admin/edit.php2,104 ▲11.99 ▼0.0336.75 ▼3.9031.83 ▼5.92
Add New Post /wp-admin/post-new.php1,530 ▲422.89 ▼0.18652.14 ▼50.1154.61 ▼1.96
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.01108.17 ▲6.6445.46 ▼0.44
GitHub Sync /wp-admin/options-general.php?page=wp-github-sync9112.0323.2431.89

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/examples/yaml-load.php
    • > /wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/php4/5to4.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WordPress_GitHub_Sync_Base_Client' not found in wp-content/plugins/wp-github-sync/lib/client/persist.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-github-sync/views/setting-field.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-github-sync/views/options.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/tests/IndentTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Autoload\\AutoloadGenerator' not found in wp-content/plugins/wp-github-sync/vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-github-sync/wp-github-sync.php:40
    • > PHP Warning
      file_get_contents(../spyc.php): failed to open stream: No such file or directory in wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/php4/5to4.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/tests/LoadTest.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-github-sync/views/user-setting-field.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-github-sync/vendor/mustangostang/spyc/tests/ParseTest.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 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
6 plugin tags: github, git, publishing, collaboration, version control...

wp-github-sync/wp-github-sync.php Passed 13 tests

The entry point to "WordPress GitHub Sync" version 2.0.1 is a PHP file that has certain tags in its header comment area
77 characters long description:
A WordPress plugin to sync content with a GitHub repository (or Jekyll site).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin5,601 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP481,4162,5974,920
PO File2100107264
YAML57234196
JSON300143
Markdown217050
XML10028

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity20.29
▷ Minimum class complexity1.00
▷ Maximum class complexity257.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods452
▷ Static methods194.20%
▷ Public methods35778.98%
▷ Protected methods449.73%
▷ Private methods5111.28%
Functions14
▷ Named functions1285.71%
▷ Anonymous functions214.29%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin