73% contentmx-content-publisher

Code Review | ContentMX Content Publisher

WordPress plugin ContentMX Content Publisher scored73%from 54 tests.

About plugin

  • Plugin page: contentmx-content...
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Oct 8, 2021
  • Latest release: Apr 4, 2023
  • Number of updates: 18
  • Update frequency: every 30.2 days
  • Top authors: contentmx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,750 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.58MB] [CPU: ▼12.65ms] Passed 4 tests

A check of server-side resources used by ContentMX Content Publisher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.69 ▼4.05
Dashboard /wp-admin3.40 ▲0.1046.09 ▼0.10
Posts /wp-admin/edit.php3.52 ▲0.1650.69 ▲4.56
Add New Post /wp-admin/post-new.php3.28 ▼2.6134.83 ▼48.33
Media Library /wp-admin/upload.php3.32 ▲0.1034.43 ▲1.89

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: 2 new tables, 9 new options
New tables
wp_contentmx_block_list
wp_contentmx_ccm
New WordPress options
widget_recent-comments
db_upgraded
cmx_ccm_vers
cmx_ccm_ip_whitelist
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
cmx_ccm_call_dir_target

Browser metrics Passed 4 tests

An overview of browser requirements for ContentMX Content Publisher
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.29 ▼1.331.59 ▼0.6041.45 ▼10.39
Dashboard /wp-admin2,212 ▲245.79 ▲0.87102.61 ▼5.4440.58 ▲1.03
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.0640.11 ▲2.1435.51 ▲0.01
Add New Post /wp-admin/post-new.php1,552 ▲3818.32 ▲0.70647.13 ▼26.5451.35 ▼3.41
Media Library /wp-admin/upload.php1,400 ▲124.32 ▲0.1095.74 ▼10.3941.41 ▼0.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 2 tables
    • wp_contentmx_ccm
    • wp_contentmx_block_list
  • Zombie WordPress options were found after uninstall: 9 options
    • theysaidso_admin_options
    • cmx_ccm_vers
    • db_upgraded
    • cmx_ccm_ip_whitelist
    • cmx_ccm_call_dir_target
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/contentmx-content-publisher/index_cmx.php:14
    • > PHP Notice
      Trying to get property 'wp_posts' of non-object in wp-content/plugins/contentmx-content-publisher/inc/admin.php on line 10
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/contentmx-content-publisher/inc/admin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/contentmx-content-publisher/inc/admin.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function contentmx_content_manager\\get_option() in wp-content/plugins/contentmx-content-publisher/inc/functions.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)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (After you have installed the plugin and activated it. Create a Wordpress network in your ContentMX account. Add a plugin to that network using the URL of your wordpress site. Click the plus icon to add the URL.), #2 (Click "Activate connection" next to the plugin you just added. This will prompt you to login to your Wordpress site and authorize the connection. Once you sign in, you should see the ContentMX account has been added to Wordpress.), #3 (Now go back to your Wordpress network or add a new network in your ContentMX account. You should see that the connection has been established. Click "Test connection" next to the plugin. This will verify that you can publish content and that nothing is blocking this feature.), #4 (If you see "Connected" and "Able to post" in green next to your plugin you can now check the radio button next to the plugin to select it as the connection for this Wordpress network.), #5 (Scroll to the bottom of the page and click to Save the network.)
The official readme.txt is a good inspiration

contentmx-content-publisher/index_cmx.php 69% from 13 tests

"ContentMX Content Publisher" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.0" instead of "5.6")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 362 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("contentmx-content-publisher.php" instead of "index_cmx.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin528 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP310549528

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions2095.24%
▷ Anonymous functions14.76%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.34MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/2.png71.19KB26.01KB▼ 63.47%
assets/1.png77.15KB27.87KB▼ 63.88%
assets/4.png99.75KB34.89KB▼ 65.02%
assets/5.png21.67KB9.00KB▼ 58.46%
assets/3.png74.96KB27.37KB▼ 63.49%