Plugin Directory

Changeset 2548933


Ignore:
Timestamp:
06/16/2021 12:52:29 PM (5 years ago)
Author:
resoc
Message:

Version 1.0.4

Location:
resoc/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • resoc/trunk/README.txt

    r2548896 r2548933  
    55Requires at least: 5.0
    66Tested up to: 5.7.2
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8181== Changelog ==
    8282
     83= 1.0.4 =
     84* Notice to guide user on activation
     85
    8386= 1.0.3 =
    8487* Fix issue in the previous release
  • resoc/trunk/admin/class-resoc-admin.php

    r2548884 r2548933  
    5555    add_action( 'save_post',
    5656      array( $this, 'save_social_image' ) );
     57
     58    add_action( 'admin_notices', array( $this, 'finish_setup_notice' ));
    5759  }
    5860
     
    7577    if ( !$featured_image ) {
    7678      Resoc_Utils::log( "Cannot turn featured image URL (" . $feature_image_url . ") to Base64" );
     79      return;
     80    }
     81
     82    if ( !Resoc_Utils::plugin_configured() ) {
     83      Resoc_Utils::log( "Plugin is not configured" );
    7784      return;
    7885    }
     
    118125
    119126    Resoc_Utils::log( "OpenGraph image " . $social_image_id . " attached to post " . $post_ID );
     127  }
     128
     129  public function finish_setup_notice() {
     130    if ( Resoc_Utils::plugin_configured() ) {
     131      return;
     132    }
     133
     134    $settings_page_url = admin_url( '/themes.php?page=resoc_social_images_appearance_menu' );
     135    if ( Resoc_Utils::current_url() == $settings_page_url ) {
     136      return;
     137    }
     138
     139    ?>
     140    <div class="notice notice-warning is-dismissible">
     141      <p>
     142        <strong>Resoc Social Images</strong> is almost ready!
     143        <a href="<?php echo $settings_page_url ?>">Choose your template</a>
     144        to complete the setup.
     145      </p>
     146    </div>
     147    <?php
    120148  }
    121149
  • resoc/trunk/includes/class-resoc-utils.php

    r2548884 r2548933  
    118118  }
    119119
     120  public static function plugin_configured() {
     121    $plugin_options = get_option( Resoc_Settings::OPTIONS );
     122    if ( !$plugin_options ) {
     123      return false;
     124    }
     125
     126    return (
     127      $plugin_options[ Resoc_Settings::TEMPLATE ] &&
     128      $plugin_options[ Resoc_Settings::BACKGROUND_COLOR ] &&
     129      $plugin_options[ Resoc_Settings::TEXT_COLOR ] &&
     130      $plugin_options[ Resoc_Settings::BRAND_NAME ]
     131    );
     132  }
     133
     134  public static function current_url() {
     135    if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ) {
     136      $prefix = "https://";
     137    }
     138    else {
     139      $prefix = "http://";
     140    }
     141
     142    return $prefix . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     143  }
     144
    120145  public static function log( $value ) {
    121146    if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
  • resoc/trunk/resoc.php

    r2548896 r2548933  
    1717 * Plugin URI:        https://resoc.io/resoc-uri/
    1818 * Description:       This is a short description of what the plugin does. It's displayed in the WordPress admin area.
    19  * Version:           1.0.3
     19 * Version:           1.0.4
    2020 * Author:            Resoc
    2121 * Author URI:        https://resoc.io/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'RESOC_VERSION', '1.0.3' );
     38define( 'RESOC_VERSION', '1.0.4' );
    3939
    4040/**
Note: See TracChangeset for help on using the changeset viewer.