GithubHelp home page GithubHelp logo

classicpress / cc-compat-woo Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 78 KB

Plugin to facilitate Classic Commerce compatibility with WooCommerce Addons

License: GNU General Public License v2.0

PHP 100.00%
classic-commerce classicpress classicpress-plugin commerce-compatibility woocommerce-compatibility

cc-compat-woo's Introduction

ClassicPress: The CMS for Creators. Stable. Lightweight. Instantly Familiar.

ClassicPress is a community-led open source content management system for creators. It is a fork of WordPress 6.2 that preserves the TinyMCE classic editor as the default option. It is half the size of WordPress, contains less bloat improving performance, and has no block editor (Gutenberg/Full Site Editing).

Coding Standards PHPUnit Tests JavaScript Tests PHP Compatibility Financial Contributors

For more information, see:

Contributions

This project exists thanks to all the people who contribute and who have contributed in the past, whether as part of the long history of thousands of contributions to WordPress from many different people, or as contributions to ClassicPress itself.

Would you like to help? Here is how you can start ›

Sponsors

Corporate sponsors that believe in ClassicPress. Become a sponsor › All donations are tax-deductible in the United States.

Brinkhost IT Tukutoi

Financial Contributors

Support the ClassicPress project by making a donation › All donations are tax-deductible in the United States.

Individuals

Financial contributors

Organizations

Financial contributors

cc-compat-woo's People

Contributors

bahiirwa avatar nylen avatar timbocode avatar zulfgani avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cc-compat-woo's Issues

Create bash install script

Script needs to zip contents of cc-compat-woo to woocommerce.zip which then extracts to woocommerce/woocommerce.php.

Change folder name on plugin download and activate it.

As agreed in ClassicPress/classic-commerce#131 (comment)

  1. We have delegated the uninstallation of the WooCommerce plugin to the website owner.
  2. This plugin on install and activation runs under the folder named cc-compat-woo with file woocommerce.php
  3. We need to rewrite its name to folder named woocommerce with file woocommerce.php
  4. Issue arises - CP will reocgnize the that plugin cc-compat-woo/woocommerce.php is no longer active in the plugins_options array. With this, the newly renamed woocommerce/woocommerce.php* won't work. It is inactive until activated again.
  5. The Challenge is rename the folder and activate it.

Of course this is easy for an experiences developer to use a command line and accomplish all these tasks. How do we get the ordinary user who downloaded this plugin to do these tasks in one click of the button?

Change UPDATE_SERVER constant

New address for plugin updates: officialplugins.classicpress.net.

Need to change UPDATE_SERVER constant in /includes/UpdateClient.class.php.

Prevent the compat plugin from activating if CC isn't activated

Further to this forum thread, it would seem sensible to prevent the compat plugin from activating if Classic Commerce itself isn't already activated.

Similarly, if both CC and the compat plugin are active and then CC is deactivated, the compat plugin should be deactivated at the same time.

This may help to prevent some installation / migration issues as mentioned in the forum post.

Publish to packagist for use with composer

Hi, I am using bedrock and would like to install this plugin just like I do with Classic Commerce (see ClassicPress/classic-commerce#239).

composer create-project roots/bedrock
cd bedrock
composer remove roots/wordpress
composer require classicpress/classicpress:~1.0
composer require classicpress-research/classic-commerce

Maybe you could publish a package to packagist or wpackagist? ❤️

Thank you for your great efforts to preserve our freedoms and a happy new year! 🎉

Rename plugin as reported by Plugin Name header

Plugin name should not begin with 'WooCommerce' as this violates Automattic trademarks etc.

Plugin should be named "CC Compatibility for WooCommerce" or "CC Compat with WooCommerce".

File name should be left as woocommerce.php and must be located in woocommerce directory.

Common errors for plugin extensions methods with CC

The compat plugin is a good idea which I have seen used elsewhere. It basically works on the same principle used by the creators of various malicious plugins...or "real" fake plugins :)

In some fairly comprehensive testing, it was found that some plugins do not require WC to be active but many others do. In the case of the latter, the compat plugin will satisfy most needs.

However, the compat plugin doesn't address all issues and even creates issues of its own. For example, it may satisfy the is_plugin_active() detection but it does not address the issue of plugins looking for a specific minimum version of WC. In addition, as WC and the compat plugin both live at woocommerce/woocommerce.php, there are also issues to overcome if WC and the compat plugin are to co-exist.

Just to confirm, the recommended way to check if WC is active is:

in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )

(from https://docs.woocommerce.com/document/create-a-plugin/).

However, having tested 20 different plugins, a variety of methods were found:

| Method
-- | --
1 | in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) \|\| array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );
2 | in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )
3 | is_plugin_active( 'woocommerce/woocommerce.php' )
4 | class_exists( 'WooCommerce' )
5 | function_exists( 'WC' )
6 | is_plugin_active( 'woocommerce.php' )

COMMENTS & RECOMMENDATIONS
(based on the above testing and Slack discussions)

Originally posted by @timbocode in ClassicPress/classic-commerce#131 (comment)

Add images to update process?

Not sure if this is necessary, but currently updating the cc-compat-woo plugin shows this:

update

Do we want to add images? (I guess we would use the same as CC)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.