Skip to content

Commit

Permalink
Change plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
rajanvijayan committed Dec 3, 2024
1 parent 3e3292a commit 22733dc
Show file tree
Hide file tree
Showing 33 changed files with 161 additions and 161 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Zip the plugin
run: |
zip -r sm-post-connector-package.zip . -x "*.git*" -x "*.github*" -x "*.yml" -x "phpunit.xml" -x "tests/**" -x "docs/**"
zip -r blog-post-connector-package.zip . -x "*.git*" -x "*.github*" -x "*.yml" -x "phpunit.xml" -x "tests/**" -x "docs/**"
- name: Create Release
id: create_release
Expand All @@ -50,7 +50,7 @@ jobs:
with:
tag_name: ${{ env.VERSION }} # Use the validated version tag
release_name: SM Plugin ${{ env.VERSION }}
body: "Release of SM Post Connector plugin version ${{ env.VERSION }}."
body: "Release of Blog Post Connector plugin version ${{ env.VERSION }}."
draft: false
prerelease: false

Expand All @@ -60,6 +60,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sm-post-connector-package.zip
asset_name: sm-post-connector-package.zip
asset_path: ./blog-post-connector-package.zip
asset_name: blog-post-connector-package.zip
asset_content_type: application/zip
16 changes: 8 additions & 8 deletions sm-post-connector.php → blog-post-connector.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* Plugin Name: SM Post Connector
* Description: A plugin to connect WordPress with the Social Marketing tool.
* Plugin Name: Blog Post Connector
* Description: A plugin to publish blogs to your WordPress website.
* Version: 0.0.3
* Author: Website Pro WordPress Team
* Text Domain: sm-post-connector
* Author: Website Pro, a WordPress hosting platform.
* Text Domain: blog-post-connector
*/

if (!defined('ABSPATH')) {
Expand All @@ -14,10 +14,10 @@
// Autoload the classes using Composer
require_once __DIR__ . '/vendor/autoload.php';

use VPlugins\SMPostConnector\Auth\Token;
use VPlugins\SMPostConnector\Updater\Update;
use VPlugins\SMPostConnector\Webhook\Webhook;
use VPlugins\SMPostConnector\Endpoints\{
use VPlugins\BlogPostConnector\Auth\Token;
use VPlugins\BlogPostConnector\Updater\Update;
use VPlugins\BlogPostConnector\Webhook\Webhook;
use VPlugins\BlogPostConnector\Endpoints\{
CreatePost,
DeletePost,
UpdatePost,
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "vplugins/sm-post-connector",
"description": "A plugin to connect WordPress with the Social Marketing tool.",
"name": "vplugins/blog-post-connector",
"description": "A plugin to publish blogs to your WordPress website.",
"type": "wordpress-plugin",
"autoload": {
"psr-4": {
"VPlugins\\SMPostConnector\\": "includes/"
"VPlugins\\BlogPostConnector\\": "includes/"
}
},
"require": {
Expand Down
4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: SM Post Connector
description: A plugin to connect WordPress with the Social Marketing tool.
title: Blog Post Connector
description: A plugin to publish blogs to your WordPress website.
show_downloads: true
google_analytics:
theme: jekyll-theme-minimal
8 changes: 4 additions & 4 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# FAQ - SM Post Connector Plugin
# FAQ - Blog Post Connector Plugin

## General Questions

### What is the SM Post Connector Plugin?
### What is the Blog Post Connector Plugin?

The SM Post Connector Plugin is a WordPress plugin that provides REST API endpoints for managing posts, authors, categories, and more. It allows you to interact with WordPress data programmatically, enabling CRUD (Create, Read, Update, Delete) operations via HTTP requests.
The Blog Post Connector Plugin is a WordPress plugin that provides REST API endpoints for managing posts, authors, categories, and more. It allows you to interact with WordPress data programmatically, enabling CRUD (Create, Read, Update, Delete) operations via HTTP requests.

### How do I authenticate requests?

Requests to the SM Post Connector API endpoints require authentication via a Bearer token. Ensure you include the `Authorization` header with a valid token in your requests.
Requests to the Blog Post Connector API endpoints require authentication via a Bearer token. Ensure you include the `Authorization` header with a valid token in your requests.

## Endpoints FAQ

Expand Down
18 changes: 9 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SM Post Connector
# Blog Post Connector

Welcome to the documentation for the **SM Post Connector** plugin. This plugin is designed to help you easily manage and integrate Social Media Post Connector within your WordPress site.
Welcome to the documentation for the **Blog Post Connector** plugin. This plugin is designed to help you easily manage and integrate Social Media Post Connector within your WordPress site.

## Table of Contents

Expand All @@ -20,14 +20,14 @@ Welcome to the documentation for the **SM Post Connector** plugin. This plugin i

## Introduction

The SM Post Connector plugin allows WordPress site administrators to seamlessly manage social media posts. With the help of various API endpoints, you can create, update, and delete posts, as well as fetch authors and categories information.
The Blog Post Connector plugin allows WordPress site administrators to seamlessly manage social media posts. With the help of various API endpoints, you can create, update, and delete posts, as well as fetch authors and categories information.

## Installation

To install the SM Post Connector plugin, follow these steps:
To install the Blog Post Connector plugin, follow these steps:

1. Download the plugin from the [GitHub repository](https://github.com/vplugins/sm-post-connector).
2. Upload the plugin files to the `/wp-content/plugins/sm-post-connector` directory.
1. Download the plugin from the [GitHub repository](https://github.com/vplugins/blog-post-connector).
2. Upload the plugin files to the `/wp-content/plugins/blog-post-connector` directory.
3. Activate the plugin through the 'Plugins' menu in WordPress.

## Configuration
Expand All @@ -39,7 +39,7 @@ After installation, configure the plugin settings:

## API Endpoints

The SM Post Connector plugin provides the following API endpoints:
The Blog Post Connector plugin provides the following API endpoints:

- **Create Post**: Allows you to create a new post. [View Details](create-post.md)
- **Update Post**: Allows you to update an existing post. [View Details](update-post.md)
Expand All @@ -57,6 +57,6 @@ For frequently asked questions, please refer to the [FAQ section](faq.md).

If you encounter any issues or need further assistance, please reach out to our support team:

- **GitHub Issues**: [Report an Issue](https://github.com/vplugins/sm-post-connector/issues)
- **GitHub Issues**: [Report an Issue](https://github.com/vplugins/blog-post-connector/issues)

Thank you for using the SM Post Connector plugin! We hope it enhances your WordPress site management experience.
Thank you for using the Blog Post Connector plugin! We hope it enhances your WordPress site management experience.
2 changes: 1 addition & 1 deletion docs/status.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `/status`

The `/status` endpoint provides information about the current status of the SM Post Connector plugin, including its version.
The `/status` endpoint provides information about the current status of the Blog Post Connector plugin, including its version.

## Endpoint

Expand Down
62 changes: 31 additions & 31 deletions includes/Auth/Token.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace VPlugins\SMPostConnector\Auth;
namespace VPlugins\BlogPostConnector\Auth;

/**
* Class Token
*
* Handles token generation, validation, and plugin settings page for the SM Post Connector plugin.
* Handles token generation, validation, and plugin settings page for the Blog Post Connector plugin.
*/
class Token {

Expand Down Expand Up @@ -48,10 +48,10 @@ public function validate_token($token) {
*/
public function add_settings_page() {
add_options_page(
__('SM Post Connector Settings', 'sm-post-connector'),
__('SM Post Connector', 'sm-post-connector'),
__('Blog Post Connector Settings', 'blog-post-connector'),
__('Blog Post Connector', 'blog-post-connector'),
'manage_options',
'sm-post-connector',
'blog-post-connector',
[$this, 'render_settings_page']
);
}
Expand All @@ -60,7 +60,7 @@ public function add_settings_page() {
* Enqueue media uploader script
*/
public function enqueue_media_uploader($hook) {
if ($hook !== 'settings_page_sm-post-connector') {
if ($hook !== 'settings_page_blog-post-connector') {
return;
}
wp_enqueue_media(); // Enqueue media uploader script
Expand All @@ -78,55 +78,55 @@ public function register_settings() {

add_settings_section(
'sm_post_connector_settings_section_token',
__('Token Settings', 'sm-post-connector'),
__('Token Settings', 'blog-post-connector'),
null,
'sm-post-connector-token'
'blog-post-connector-token'
);

add_settings_section(
'sm_post_connector_settings_section_post',
__('Post Settings', 'sm-post-connector'),
__('Post Settings', 'blog-post-connector'),
null,
'sm-post-connector-post'
'blog-post-connector-post'
);

add_settings_field(
'sm_post_connector_token',
__('Access Token', 'sm-post-connector'),
__('Access Token', 'blog-post-connector'),
[$this, 'render_token_field'],
'sm-post-connector-token',
'blog-post-connector-token',
'sm_post_connector_settings_section_token'
);

add_settings_field(
'sm_post_connector_default_post_type',
__('Default Post Type', 'sm-post-connector'),
__('Default Post Type', 'blog-post-connector'),
[$this, 'render_post_type_field'],
'sm-post-connector-post',
'blog-post-connector-post',
'sm_post_connector_settings_section_post'
);

add_settings_field(
'sm_post_connector_default_author',
__('Default Author', 'sm-post-connector'),
__('Default Author', 'blog-post-connector'),
[$this, 'render_author_field'],
'sm-post-connector-post',
'blog-post-connector-post',
'sm_post_connector_settings_section_post'
);

add_settings_field(
'sm_post_connector_default_category',
__('Default Category', 'sm-post-connector'),
__('Default Category', 'blog-post-connector'),
[$this, 'render_category_field'],
'sm-post-connector-post',
'blog-post-connector-post',
'sm_post_connector_settings_section_post'
);

add_settings_field(
'sm_post_connector_logo',
__('Site Logo', 'sm-post-connector'),
__('Site Logo', 'blog-post-connector'),
[$this, 'render_logo_field'],
'sm-post-connector-post',
'blog-post-connector-post',
'sm_post_connector_settings_section_post'
);
}
Expand All @@ -138,27 +138,27 @@ public function render_settings_page() {
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'token';
?>
<div class="wrap">
<h1><?php echo esc_html(__('SM Post Connector Settings', 'sm-post-connector')); ?></h1>
<h1><?php echo esc_html(__('Blog Post Connector Settings', 'blog-post-connector')); ?></h1>
<h2 class="nav-tab-wrapper">
<a href="?page=sm-post-connector&tab=token" class="nav-tab <?php echo $active_tab == 'token' ? 'nav-tab-active' : ''; ?>"><?php echo esc_html(__('Token Settings', 'sm-post-connector')); ?></a>
<a href="?page=sm-post-connector&tab=post" class="nav-tab <?php echo $active_tab == 'post' ? 'nav-tab-active' : ''; ?>"><?php echo esc_html(__('Post Settings', 'sm-post-connector')); ?></a>
<a href="?page=blog-post-connector&tab=token" class="nav-tab <?php echo $active_tab == 'token' ? 'nav-tab-active' : ''; ?>"><?php echo esc_html(__('Token Settings', 'blog-post-connector')); ?></a>
<a href="?page=blog-post-connector&tab=post" class="nav-tab <?php echo $active_tab == 'post' ? 'nav-tab-active' : ''; ?>"><?php echo esc_html(__('Post Settings', 'blog-post-connector')); ?></a>
</h2>
<form method="post" action="options.php">
<?php
if ($active_tab == 'token') {
settings_fields('sm_post_connector_settings_token');
do_settings_sections('sm-post-connector-token');
do_settings_sections('blog-post-connector-token');
} else {
settings_fields('sm_post_connector_settings');
do_settings_sections('sm-post-connector-post');
do_settings_sections('blog-post-connector-post');
}
submit_button(__('Save Changes', 'sm-post-connector'), 'primary');
submit_button(__('Save Changes', 'blog-post-connector'), 'primary');
?>
</form>
<?php if ($active_tab == 'token'): ?>
<form method="post">
<input type="hidden" name="generate_new_token" value="1">
<?php submit_button(__('Generate New Token', 'sm-post-connector'), 'secondary'); ?>
<?php submit_button(__('Generate New Token', 'blog-post-connector'), 'secondary'); ?>
</form>
<?php $this->handle_generate_token_request(); ?>
<?php endif; ?>
Expand Down Expand Up @@ -222,7 +222,7 @@ public function render_post_type_field() {
* Renders the field for selecting the default author.
*/
public function render_author_field() {
$authors = get_users(['who' => 'authors']);
$authors = get_users( ['capability' => 'edit_posts'] );
$default_author = get_option('sm_post_connector_default_author', '');

?>
Expand Down Expand Up @@ -261,7 +261,7 @@ public function render_logo_field() {
$logo = get_option('sm_post_connector_logo'); // Retrieve the logo option
?>
<input type="hidden" id="sm_post_connector_logo" name="sm_post_connector_logo" value="<?php echo esc_attr($logo); ?>" />
<button type="button" class="button" id="sm_post_connector_upload_logo" style="margin-bottom: 10px !important;"><?php _e('Upload Logo', 'sm-post-connector'); ?></button>
<button type="button" class="button" id="sm_post_connector_upload_logo" style="margin-bottom: 10px !important;"><?php _e('Upload Logo', 'blog-post-connector'); ?></button>
<div id="sm_post_connector_logo_preview">
<?php if ($logo): ?>
<img src="<?php echo esc_url($logo); ?>" style="max-width: 150px; max-height: 150px;">
Expand All @@ -280,9 +280,9 @@ public function render_logo_field() {
}

mediaUploader = wp.media.frames.file_frame = wp.media({
title: '<?php _e('Select Logo', 'sm-post-connector'); ?>',
title: '<?php _e('Select Logo', 'blog-post-connector'); ?>',
button: {
text: '<?php _e('Select Logo', 'sm-post-connector'); ?>'
text: '<?php _e('Select Logo', 'blog-post-connector'); ?>'
},
multiple: false
});
Expand Down
6 changes: 3 additions & 3 deletions includes/Endpoints/CreatePost.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace VPlugins\SMPostConnector\Endpoints;
namespace VPlugins\BlogPostConnector\Endpoints;

use VPlugins\SMPostConnector\Helper\BasePost;
use VPlugins\BlogPostConnector\Helper\BasePost;

/**
* Class CreatePost
*
* Registers a REST API endpoint for creating posts.
*
* @package VPlugins\SMPostConnector\Endpoints
* @package VPlugins\BlogPostConnector\Endpoints
*/
class CreatePost extends BasePost {

Expand Down
8 changes: 4 additions & 4 deletions includes/Endpoints/DeletePost.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace VPlugins\SMPostConnector\Endpoints;
namespace VPlugins\BlogPostConnector\Endpoints;

use WP_REST_Request;
use VPlugins\SMPostConnector\Middleware\AuthMiddleware;
use VPlugins\SMPostConnector\Helper\Response;
use VPlugins\BlogPostConnector\Middleware\AuthMiddleware;
use VPlugins\BlogPostConnector\Helper\Response;

/**
* Class DeletePost
*
* Registers a REST API endpoint for deleting posts.
*
* @package VPlugins\SMPostConnector\Endpoints
* @package VPlugins\BlogPostConnector\Endpoints
*/
class DeletePost {
/**
Expand Down
10 changes: 5 additions & 5 deletions includes/Endpoints/GetAuthors.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace VPlugins\SMPostConnector\Endpoints;
namespace VPlugins\BlogPostConnector\Endpoints;

use WP_REST_Request;
use VPlugins\SMPostConnector\Middleware\AuthMiddleware;
use VPlugins\SMPostConnector\Helper\Globals;
use VPlugins\SMPostConnector\Helper\Response;
use VPlugins\BlogPostConnector\Middleware\AuthMiddleware;
use VPlugins\BlogPostConnector\Helper\Globals;
use VPlugins\BlogPostConnector\Helper\Response;

/**
* Class GetAuthors
*
* Registers a REST API endpoint for retrieving authors.
*
* @package VPlugins\SMPostConnector\Endpoints
* @package VPlugins\BlogPostConnector\Endpoints
*/
class GetAuthors {
/**
Expand Down
Loading

0 comments on commit 22733dc

Please sign in to comment.