GithubHelp home page GithubHelp logo

dilden / x-post Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 21 KB

WordPress plugin to send published posts to social media platforms

License: GNU General Public License v3.0

PHP 100.00%
telegram wordpress-plugin

x-post's Introduction

x-post by closingtags

What is this?

A WordPress plugin for sharing published posts to various social media platforms and networks.

Requirements

  • Working WordPress installation
  • ngrok
  • docker-compose (optional)

Installation

Set up a WordPress installation (via the next section) and then clone this repo into the plugins directory of the WordPress installation.

Set up w/docker-compose

To set up a quick WordPress environment, a docker-compose.yml similar to this may be used:

services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=somewordpress
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD=wordpress
    ports:
      - 33060:3306
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    volumes:
      - ./:/var/www/html
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
      - WORDPRESS_DB_NAME=wordpress
volumes:
  db_data:

Development

To get this plugin to set valid webhooks for a development version of the site, a few things need to be done:

  1. Be sure to install the relative-url plugin.
  2. Set these options set in wp-config.php to forward traffic appropriately:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
  1. Start ngrok: ngrok http --host-header=rewrite http://localhost:8000 or a valid ngrok config might look like this:
version: "2"
authtoken: YOUR_TOKEN_HERE

tunnels:
  x-post:
    proto: http
    addr: localhost:8000
    host_header: rewrite

See ngrok documentation for more information.

Permissions

It's inevitable to run into permissions issues. On initial setup, everything should work fine for the web server but once ownership/permissions get changed, the WP Admin interface will start running into issues. The commands to set default permisssion are: find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \; for directories find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \; for files

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.