Skip to content

Commit

Permalink
Fix install urls
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyzen authored Jan 23, 2023
1 parent 79c7e68 commit 9c53e5c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions woonuxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function required_plugins_callback() {
Installed <?php echo $tick_svg_icon; ?>
<?php endif; ?>
<?php if ( !is_plugin_active( 'wp-graphql/wp-graphql.php' ) ) : ?>
<a href="https://wordpress.org/plugins/wp-graphql/">Install</a>
<a href="/wp-admin/options-general.php?page=woonuxt&install_plugin=wp-graphql">Install</a>
<?php endif; ?>
</div>
</li>
Expand All @@ -118,7 +118,7 @@ function required_plugins_callback() {
Installed <?php echo $tick_svg_icon; ?>
<?php endif; ?>
<?php if ( !is_plugin_active( 'wp-graphql-woocommerce/wp-graphql-woocommerce.php' ) ) : ?>
<a href="https://woonuxt.com/wp-admin/options-general.php?page=woonuxt&install_plugin=woographql">Install Now</a>
<a href="/wp-admin/options-general.php?page=woonuxt&install_plugin=woographql">Install Now</a>
<?php endif; ?>
</div>
</li>
Expand All @@ -132,7 +132,7 @@ function required_plugins_callback() {
Installed <?php echo $tick_svg_icon; ?>
<?php endif; ?>
<?php if ( !is_plugin_active( 'wp-graphql-cors-2.1/wp-graphql-cors.php' ) ) : ?>
<a href="https://woonuxt.com/wp-admin/options-general.php?page=woonuxt&install_plugin=wp-graphql-cors">Install Now</a>
<a href="/wp-admin/options-general.php?page=woonuxt&install_plugin=wp-graphql-cors">Install Now</a>
<?php endif; ?>
</div>
</li>
Expand All @@ -142,6 +142,17 @@ function required_plugins_callback() {

if ( isset( $_GET['install_plugin'] ) ) {

// https://downloads.wordpress.org/plugin/wp-graphql.1.13.7.zip
if ( $_GET['install_plugin'] == 'wp-graphql' && ! is_plugin_active( 'wp-graphql/wp-graphql.php' ) ) {
$url = 'https://downloads.wordpress.org/plugin/wp-graphql.1.13.7.zip';
$upgrader = new Plugin_Upgrader();
$result = $upgrader->install( $url );
if ( ! is_wp_error( $result ) ) {
activate_plugin( 'wp-graphql/wp-graphql.php' );
}
}


// https://github.com/wp-graphql/wp-graphql-woocommerce/releases/download/v0.12.0/wp-graphql-woocommerce.zip
if ( $_GET['install_plugin'] == 'woographql' && ! is_plugin_active( 'wp-graphql-woocommerce/wp-graphql-woocommerce.php' ) ) {
$url = 'https://github.com/wp-graphql/wp-graphql-woocommerce/releases/download/v0.12.0/wp-graphql-woocommerce.zip';
Expand All @@ -167,7 +178,6 @@ function required_plugins_callback() {
}
}


}
}

Expand Down Expand Up @@ -399,14 +409,15 @@ class="widefat"

// deploy-button FROM build_hook
const buildUrl = $('#build_url');
console.log(buildUrl.val());
$('#deploy-button').click(function(e) {
console.log('clicked');
e.preventDefault();
$.ajax({
url: buildUrl.val(),
type: 'POST',
success: function(data) {
alert('Build triggered successfully');
console.log(data);
}
});
});
Expand Down

0 comments on commit 9c53e5c

Please sign in to comment.