├── config └── post-meta.json ├── assets └── css │ └── admin.css ├── CHANGELOG.md ├── tailwind.config.js ├── .deployignore ├── .gitignore ├── phpstan.neon ├── .editorconfig ├── .gitattributes ├── package.json ├── autoblogging-pro.php ├── composer.json ├── src ├── class-autoblogging-pro.php ├── Admin │ └── SettingsPage.php ├── Service │ ├── ImageService.php │ ├── SeoIntegrationService.php │ └── ArticleService.php └── meta.php ├── buddy.yml ├── README.md ├── LICENSE └── templates └── settings.php /config/post-meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /assets/css/admin.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | .btn_action { 6 | @apply transition ease-in-out duration-150; 7 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `AutoBlogging Pro` will be documented in this file. 4 | 5 | ## 0.1.0 - 202X-XX-XX 6 | 7 | - Initial release 8 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./templates/**/*.php", 5 | "./src/**/*.php", 6 | "./*.php" 7 | ], 8 | theme: { 9 | extend: {}, 10 | }, 11 | plugins: [], 12 | } 13 | -------------------------------------------------------------------------------- /.deployignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | wp-cli.local.yml 4 | node_modules/ 5 | *.sql 6 | *.tar.gz 7 | *.zip 8 | .phpunit.result.cache 9 | Dockerfile 10 | output.log 11 | .github 12 | tests 13 | bin 14 | composer.lock 15 | .phpcs.xml 16 | phpunit.xml 17 | configure.php 18 | DOCKER_ENV 19 | phpunit.xml 20 | tests 21 | .phpcs 22 | Makefile 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build files 2 | build 3 | composer.lock 4 | node_modules 5 | test 6 | # Log files 7 | *.log 8 | 9 | # Cache files 10 | .phpcs/*.json 11 | .phpunit.result.cache 12 | 13 | # Ignore temporary OS files 14 | .DS_Store 15 | .DS_Store? 16 | .Spotlight-V100 17 | .Trashes 18 | ehthumbs.db 19 | Thumbs.db 20 | .thumbsdb 21 | 22 | # IDE files 23 | *.code-workspace 24 | .idea 25 | .vscode 26 | .vendor 27 | .github 28 | 29 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/szepeviktor/phpstan-wordpress/extension.neon 3 | 4 | parameters: 5 | # Level 9 is the highest level 6 | level: max 7 | 8 | paths: 9 | - blocks/ 10 | - entries/ 11 | - src/ 12 | - autoblogging-pro.php 13 | 14 | # ignoreErrors: 15 | # - '#PHPDoc tag @var#' 16 | # 17 | # excludePaths: 18 | # - ./*/*/FileToBeExcluded.php 19 | # 20 | # checkMissingIterableValueType: false 21 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = tab 9 | indent_size = 4 10 | 11 | [*.{ts,tsx,js,jsx,scss,css,json,yaml,yml,feature,xml}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Composer File 16 | [composer.{json,lock}] 17 | indent_style = space 18 | indent_size = 4 19 | 20 | # Dotfiles 21 | [.*] 22 | indent_style = space 23 | indent_size = 2 24 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # Exclude these files from release archives. 3 | # 4 | # This will also make the files unavailable when using Composer with `--prefer-dist`. 5 | # 6 | # Via WPCS. 7 | # 8 | /.github export-ignore 9 | /.phpcs.xml export-ignore 10 | /.phpcs export-ignore 11 | /phpunit.xml export-ignore 12 | /tests export-ignore 13 | /configure.php export-ignore 14 | /Makefile export-ignore 15 | 16 | # 17 | # Auto detect text files and perform LF normalization. 18 | # 19 | # http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ 20 | # 21 | * text=auto 22 | 23 | # 24 | # The above will handle all files not found below. 25 | # 26 | *.md text 27 | *.php text 28 | *.inc text 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-plugin", 3 | "version": "1.0.0", 4 | "description": "Contributors: essamamdani", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1", 11 | "build": "tailwindcss -i ./assets/css/admin.css -o ./assets/css/admin.min.css --minify", 12 | "watch": "tailwindcss -i ./assets/css/admin.css -o ./assets/css/admin.min.css --watch" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/essamamdani/autobloggging-pro.git" 17 | }, 18 | "keywords": [], 19 | "author": "", 20 | "license": "ISC", 21 | "type": "commonjs", 22 | "bugs": { 23 | "url": "https://github.com/essamamdani/autobloggging-pro/issues" 24 | }, 25 | "homepage": "https://github.com/essamamdani/autobloggging-pro#readme", 26 | "devDependencies": { 27 | "@tailwindcss/cli": "^4.1.18", 28 | "autoprefixer": "^10.4.23", 29 | "postcss": "^8.5.6", 30 | "tailwindcss": "^4.1.18" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /autoblogging-pro.php: -------------------------------------------------------------------------------- 1 | init_hooks(); 14 | $this->init_admin(); 15 | } 16 | 17 | public static function instance() { 18 | if ( ! self::$instance ) { 19 | self::$instance = new self(); 20 | } 21 | return self::$instance; 22 | } 23 | 24 | private function init_hooks() { 25 | // Schedule Cron 26 | add_action( 'autoblogging_pro_sync_event', [ $this, 'execute_sync' ] ); 27 | 28 | // Activation/Deactivation 29 | register_activation_hook( AUTOBLOGGING_PRO_FILE, [ $this, 'activate' ] ); 30 | register_deactivation_hook( AUTOBLOGGING_PRO_FILE, [ $this, 'deactivate' ] ); 31 | } 32 | 33 | private function init_admin() { 34 | if ( is_admin() ) { 35 | $settings_page = new SettingsPage(); 36 | $settings_page->init(); 37 | } 38 | } 39 | 40 | public function execute_sync() { 41 | try { 42 | $article_service = new ArticleService(); 43 | $article_service->fetch_and_sync(); 44 | } catch ( \Exception $e ) { 45 | error_log( 'AutoBlogging Pro Sync Error: ' . $e->getMessage() ); 46 | } catch ( \Error $e ) { 47 | error_log( 'AutoBlogging Pro Sync Fatal Error: ' . $e->getMessage() ); 48 | } 49 | } 50 | 51 | public function activate() { 52 | if ( ! wp_next_scheduled( 'autoblogging_pro_sync_event' ) ) { 53 | wp_schedule_event( time(), 'hourly', 'autoblogging_pro_sync_event' ); 54 | } 55 | 56 | // Defaults 57 | add_option( 'autoblogging_pro_publish_time', '12:00' ); 58 | add_option( 'autoblogging_pro_action', 'draft' ); 59 | } 60 | 61 | public function deactivate() { 62 | wp_clear_scheduled_hook( 'autoblogging_pro_sync_event' ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Admin/SettingsPage.php: -------------------------------------------------------------------------------- 1 | fetch_and_sync(); 89 | wp_send_json_success( 'Sync completed successfully' ); 90 | } catch ( \Exception $e ) { 91 | wp_send_json_error( $e->getMessage() ); 92 | } catch ( \Error $e ) { 93 | wp_send_json_error( $e->getMessage() ); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /buddy.yml: -------------------------------------------------------------------------------- 1 | - pipeline: "Pull Request Tests" 2 | trigger_mode: "ON_EVERY_PUSH" 3 | ref_name: "refs/pull/*" 4 | ref_type: "WILDCARD" 5 | priority: "NORMAL" 6 | target_site_url: "https://github.com/autoblogging-proo/autoblogging-pro" 7 | fetch_all_refs: true 8 | fail_on_prepare_env_warning: true 9 | trigger_condition: "ALWAYS" 10 | actions: 11 | - action: "Gitignored files check" 12 | type: "BUILD" 13 | working_directory: "/buddy/autoblogging-pro" 14 | docker_image_name: "alleyops/ci-resources" 15 | docker_image_tag: "8.0-fpm-wp" 16 | execute_commands: 17 | - "if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi" 18 | volume_mappings: 19 | - "/:/buddy/autoblogging-pro" 20 | trigger_condition: "ALWAYS" 21 | shell: "BASH" 22 | run_next_parallel: true 23 | - action: "Check for git conflicts" 24 | type: "BUILD" 25 | working_directory: "/buddy/autoblogging-pro" 26 | docker_image_name: "alleyops/ci-resources" 27 | docker_image_tag: "8.0-fpm-wp" 28 | execute_commands: 29 | - "! git grep -E '<<<<<<< |>>>>>>> ' -- './*' ':(exclude)buddy.yml' ':(exclude).buddy/*'" 30 | volume_mappings: 31 | - "/:/buddy/autoblogging-pro" 32 | trigger_condition: "ALWAYS" 33 | shell: "BASH" 34 | - action: "Composer install" 35 | type: "BUILD" 36 | working_directory: "/buddy/autoblogging-pro" 37 | docker_image_name: "alleyops/ci-resources" 38 | docker_image_tag: "8.0-fpm-wp" 39 | execute_commands: 40 | - "composer install -q" 41 | volume_mappings: 42 | - "/:/buddy/autoblogging-pro" 43 | trigger_condition: "ALWAYS" 44 | shell: "BASH" 45 | - action: "phpunit" 46 | type: "BUILD" 47 | working_directory: "/buddy/autoblogging-pro" 48 | docker_image_name: "alleyops/ci-resources" 49 | docker_image_tag: "8.0-fpm-wp" 50 | execute_commands: 51 | - "composer phpunit" 52 | setup_commands: 53 | - "echo \"extension=memcache.so\" >> /usr/local/etc/php/conf.d/buddy.ini" 54 | services: 55 | - type: "MARIADB" 56 | version: "10.3" 57 | connection: 58 | host: "mariadb" 59 | port: 3306 60 | user: "root" 61 | password: "root" 62 | db: "wordpress_unit_tests" 63 | - type: "MEMCACHED" 64 | version: "1.5.6" 65 | connection: 66 | host: "memcached" 67 | port: 11211 68 | volume_mappings: 69 | - "/:/buddy/autoblogging-pro" 70 | trigger_condition: "ALWAYS" 71 | shell: "BASH" 72 | run_next_parallel: true 73 | - action: "composer phpcs" 74 | type: "BUILD" 75 | working_directory: "/buddy/autoblogging-pro" 76 | docker_image_name: "alleyops/ci-resources" 77 | docker_image_tag: "8.0-fpm-wp" 78 | execute_commands: 79 | - "composer phpcs" 80 | volume_mappings: 81 | - "/:/buddy/autoblogging-pro" 82 | trigger_condition: "ALWAYS" 83 | shell: "BASH" 84 | variables: 85 | - key: "CACHEDIR" 86 | value: "/tmp/test-cache" 87 | type: "VAR" 88 | description: "Cache folder for remote requests." 89 | - key: "SKIP_DISCOVERY" 90 | value: "true" 91 | type: "VAR" 92 | - key: "WP_CORE_DIR" 93 | value: "/tmp/wordpress" 94 | type: "VAR" 95 | description: "WordPress checkout folder." 96 | - key: "WP_VERSION" 97 | value: "latest" 98 | type: "VAR" 99 | - key: "WP_DB_PASSWORD" 100 | value: "root" 101 | type: "VAR" 102 | - key: "WP_DB_HOST" 103 | value: "mariadb" 104 | type: "VAR" 105 | - key: "WP_SKIP_DB_CREATE" 106 | value: "true" 107 | type: "VAR" -------------------------------------------------------------------------------- /src/Service/ImageService.php: -------------------------------------------------------------------------------- 1 | loadHTML( mb_convert_encoding( $content, 'HTML-ENTITIES', 'UTF-8' ), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD ); 23 | 24 | libxml_clear_errors(); 25 | 26 | $images = $dom->getElementsByTagName( 'img' ); 27 | 28 | if ( $images->length === 0 ) { 29 | return $content; 30 | } 31 | 32 | foreach ( $images as $img ) { 33 | $src = $img->getAttribute( 'src' ); 34 | if ( ! empty( $src ) ) { 35 | $new_src = $this->sideload_image( $src, 0, 'content' ); // 0 post_id for unattached or attach later if possible, but actually we need post_id to attach. 36 | // For now, we might not have post_id creates yet if valid call is inside process_article before insert_post. 37 | // In the original code, it was doing this before insert_post, so $post_id was unknown? 38 | // Actually original code was: $img_src = $this->insert_image($img, $article->id,"content"); 39 | // Wait, it passed $article->id (the remote ID)? That's wrong for WP attachment parent. 40 | // If we pass 0, it's unattached. That's fine for content images. 41 | 42 | if ( $new_src ) { 43 | $img->setAttribute( 'src', $new_src ); 44 | // Remove srcset and sizes if they exist to avoid display issues 45 | $img->removeAttribute( 'srcset' ); 46 | $img->removeAttribute( 'sizes' ); 47 | } 48 | } 49 | } 50 | 51 | return $dom->saveHTML(); 52 | } 53 | 54 | /** 55 | * Sideload image from URL 56 | * 57 | * @param string $url 58 | * @param int $post_id Parent post ID (0 if none) 59 | * @param string $type 'featured' or 'content' 60 | * @param string $alt_text 61 | * @return string|void URL of the image if content type, void if featured (attached to post) 62 | */ 63 | public function sideload_image( $url, $post_id = 0, $type = 'featured', $alt_text = '' ) { 64 | // Validation 65 | if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) { 66 | return; 67 | } 68 | 69 | require_once ABSPATH . 'wp-admin/includes/media.php'; 70 | require_once ABSPATH . 'wp-admin/includes/file.php'; 71 | require_once ABSPATH . 'wp-admin/includes/image.php'; 72 | 73 | // desc as alt text 74 | $desc = $alt_text; 75 | 76 | // sideload handling 77 | $tmp = download_url( $url ); 78 | 79 | if ( is_wp_error( $tmp ) ) { 80 | return; 81 | } 82 | 83 | $file_array = [ 84 | 'name' => basename( $url ), 85 | 'tmp_name' => $tmp, 86 | ]; 87 | 88 | // Prepare ID for attachment if it's for a post 89 | // Check for extension 90 | preg_match( '/[^\?]+\.(jpg|jpe|jpeg|gif|png)/i', $url, $matches ); 91 | if ( ! empty( $matches ) ) { 92 | $file_array['name'] = basename( $matches[0] ); 93 | } 94 | 95 | $id = media_handle_sideload( $file_array, $post_id, $desc ); 96 | 97 | if ( is_wp_error( $id ) ) { 98 | @unlink( $file_array['tmp_name'] ); 99 | return; 100 | } 101 | 102 | if ( ! empty( $alt_text ) ) { 103 | update_post_meta( $id, '_wp_attachment_image_alt', $alt_text ); 104 | } 105 | 106 | if ( 'featured' === $type && $post_id > 0 ) { 107 | set_post_thumbnail( $post_id, $id ); 108 | } else { 109 | return wp_get_attachment_url( $id ); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoBlogging Pro 2 | 3 | Contributors: essamamdani 4 | 5 | Tags: autoblogging.proo, autoblogging-pro 6 | 7 | Stable tag: 0.1.0 8 | 9 | Requires at least: 5.9 10 | 11 | Tested up to: 6.1 12 | 13 | Requires PHP: 8.0 14 | 15 | License: GPL v2 or later 16 | 17 | [![Coding Standards](https://github.com/autoblogging-proo/autoblogging-pro/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/autoblogging-proo/autoblogging-pro/actions/workflows/coding-standards.yml) 18 | [![Testing Suite](https://github.com/autoblogging-proo/autoblogging-pro/actions/workflows/unit-test.yml/badge.svg)](https://github.com/autoblogging-proo/autoblogging-pro/actions/workflows/unit-test.yml) 19 | 20 | This is my plugin AutoBlogging Pro. 21 | 22 | ## Installation 23 | 24 | You can install the package via composer: 25 | 26 | ```bash 27 | composer require autoblogging-proo/autoblogging-pro 28 | ``` 29 | 30 | ## Usage 31 | 32 | Activate the plugin in WordPress and use it like so: 33 | 34 | ```php 35 | $plugin = AutoBlogging_Pro\AutoBlogging_Pro\AutoBlogging_Pro(); 36 | $plugin->perform_magic(); 37 | ``` 38 | 39 | ## Testing 40 | 41 | Run `npm run test` to run Jest tests against JavaScript files. Run 42 | `npm run test:watch` to keep the test runner open and watching for changes. 43 | 44 | Run `npm run lint` to run ESLint against all JavaScript files. Linting will also 45 | happen when running development or production builds. 46 | 47 | Run `composer test` to run tests against PHPUnit and the PHP code in the plugin. 48 | 49 | ### The `entries` directory and entry points 50 | 51 | All directories created in the `entries` directory can serve as entry points and will be compiled with [@wordpress/scripts](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/README.md#scripts) into the `build` directory with an accompanied `index.asset.php` asset map. 52 | 53 | #### Enqueuing Entry Points 54 | 55 | You can also include an `index.php` file in the entry point directory for enqueueing or registering a script. This file will then be moved to the build directory and will be auto-loaded with the `load_scripts()` function in the `functions.php` file. Alternatively, if a script is to be enqueued elsewhere there are helper functions in the `src/assets.php` file for getting the assets. 56 | 57 | ### Scaffold a block with `create-block` 58 | 59 | Use the `create-block` command to create custom blocks with [`@wordpress/create-block`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) and follow the prompts to generate all the block assets in the `blocks/` directory. 60 | Block registration, script creation, etc will be scaffolded from the `bin/create-block/templates/block/` templates. Run `npm run build` to compile and build the custom block. Blocks are enqueued using the `load_scripts()` function in `src/assets.php`. 61 | 62 | ### Updating WP Dependencies 63 | 64 | Update the [WordPress dependency packages](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/#packages-update) used in the project to their latest version. 65 | 66 | To update `@wordpress` dependencies to their latest version use the packages-update command: 67 | 68 | ```sh 69 | npx wp-scripts packages-update 70 | ``` 71 | 72 | This script provides the following custom options: 73 | 74 | - `--dist-tag` – allows specifying a custom dist-tag when updating npm packages. Defaults to `latest`. This is especially useful when using [`@wordpress/dependency-extraction-webpack-plugin`](https://www.npmjs.com/package/@wordpress/dependency-extraction-webpack-plugin). It lets installing the npm dependencies at versions used by the given WordPress major version for local testing, etc. Example: 75 | 76 | ```sh 77 | npx wp-scripts packages-update --dist-tag=wp-WPVERSION` 78 | ``` 79 | 80 | Where `WPVERSION` is the version of WordPress you are targeting. The version 81 | must include both the major and minor version (e.g., `6.1`). For example: 82 | 83 | ```sh 84 | npx wp-scripts packages-update --dist-tag=wp-6.1` 85 | ``` 86 | 87 | ## Changelog 88 | 89 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 90 | 91 | ## Credits 92 | 93 | This project is actively maintained by [Alley 94 | Interactive](https://github.com/autoblogging-proo). Like what you see? [Come work 95 | with us](https://alley.co/careers/). 96 | 97 | - [Essa Mamdani](https://github.com/Essa Mamdani) 98 | - [All Contributors](../../contributors) 99 | 100 | ## License 101 | 102 | The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information. -------------------------------------------------------------------------------- /src/Service/SeoIntegrationService.php: -------------------------------------------------------------------------------- 1 | handle_rank_math( $post_id, $article ); 15 | $this->handle_yoast( $post_id, $article ); 16 | $this->handle_aioseo( $post_id, $article ); 17 | $this->handle_seopress( $post_id, $article ); 18 | $this->handle_seo_framework( $post_id, $article ); 19 | } 20 | 21 | protected function handle_rank_math( $post_id, $article ) { 22 | if ( ! defined( 'RANK_MATH_FILE' ) ) { 23 | return; 24 | } 25 | 26 | update_post_meta( $post_id, 'rank_math_title', $article->title ); 27 | update_post_meta( $post_id, 'rank_math_description', $article->seo_description ); 28 | update_post_meta( $post_id, 'rank_math_focus_keyword', $article->seo_keywords ); 29 | 30 | $this->set_primary_category( $post_id, 'rank_math_primary_' ); 31 | } 32 | 33 | protected function handle_yoast( $post_id, $article ) { 34 | if ( ! defined( 'WPSEO_VERSION' ) ) { 35 | return; 36 | } 37 | 38 | update_post_meta( $post_id, '_yoast_wpseo_title', $article->title ); 39 | update_post_meta( $post_id, '_yoast_wpseo_metadesc', $article->seo_description ); 40 | update_post_meta( $post_id, '_yoast_wpseo_focuskw', $article->focus_keyphrase ); 41 | update_post_meta( $post_id, '_yoast_wpseo_schema_article_type', 'BlogPosting' ); 42 | 43 | $this->set_primary_category( $post_id, '_yoast_wpseo_primary_' ); 44 | } 45 | 46 | protected function handle_aioseo( $post_id, $article ) { 47 | if ( ! defined( 'AIOSEO_PHP_VERSION_DIR' ) ) { 48 | return; 49 | } 50 | 51 | global $wpdb; 52 | $table_name = $wpdb->prefix . 'aioseo_posts'; 53 | 54 | // Basic data structure as per original code 55 | // Optimizing random score generation 56 | $keyphrases = [ 57 | 'focus' => [ 58 | 'keyphrase' => $article->focus_keyphrase, 59 | 'score' => mt_rand( 60, 90 ), 60 | 'analysis' => [], // Simplified for now 61 | ], 62 | 'additional' => [], 63 | ]; 64 | 65 | $data = [ 66 | 'post_id' => $post_id, 67 | 'title' => $article->title, 68 | 'description' => $article->seo_description, 69 | 'keywords' => json_encode( explode( ',', $article->seo_keywords ) ), 70 | 'keyphrases' => json_encode( $keyphrases ), 71 | 'images' => json_encode( [ $article->image ] ), 72 | ]; 73 | 74 | $wpdb->insert( $table_name, $data ); 75 | } 76 | 77 | protected function handle_seopress( $post_id, $article ) { 78 | if ( ! defined( 'SEOPRESS_VERSION' ) ) { 79 | return; 80 | } 81 | 82 | update_post_meta( $post_id, '_seopress_titles_title', $article->title ); 83 | update_post_meta( $post_id, '_seopress_titles_desc', $article->seo_description ); 84 | update_post_meta( $post_id, '_seopress_analysis_target_kw', $article->focus_keyphrase ); 85 | 86 | if ( ! empty( $article->categories ) ) { 87 | $primary_category = $article->categories[0]; 88 | update_post_meta( $post_id, '_seopress_robots_primary_cat', $primary_category->term_id ); 89 | update_post_meta( $post_id, '_seopress_robots_primary_' . $primary_category->taxonomy, $primary_category->term_id ); 90 | } 91 | } 92 | 93 | protected function handle_seo_framework( $post_id, $article ) { 94 | if ( ! defined( 'THE_SEO_FRAMEWORK_VERSION' ) ) { 95 | return; 96 | } 97 | 98 | update_post_meta( $post_id, '_genesis_title', $article->title ); 99 | update_post_meta( $post_id, '_genesis_description', $article->seo_description ); 100 | update_post_meta( $post_id, '_genesis_keywords', $article->seo_keywords ); 101 | 102 | if( ! empty( $article->url ) ) { 103 | update_post_meta( $post_id, '_genesis_canonical_uri', $article->url ); 104 | } 105 | 106 | // Defaults 107 | update_post_meta( $post_id, '_genesis_noindex', '0' ); 108 | update_post_meta( $post_id, '_genesis_nofollow', '0' ); 109 | update_post_meta( $post_id, '_genesis_noarchive', '0' ); 110 | 111 | if ( ! empty( $article->categories ) ) { 112 | $primary_category = $article->categories[0]; 113 | update_post_meta( $post_id, '_genesis_primary_' . $primary_category->taxonomy, $primary_category->term_id ); 114 | } 115 | } 116 | 117 | /** 118 | * Helper to set primary category for plugins that support it 119 | * 120 | * @param int $post_id 121 | * @param string $meta_prefix 122 | */ 123 | protected function set_primary_category( $post_id, $meta_prefix ) { 124 | $categories = get_the_terms( $post_id, 'category' ); 125 | if ( $categories && ! is_wp_error( $categories ) ) { 126 | foreach ( $categories as $category ) { 127 | // Naive check for "parent" category -> if it has no children, maybe it's primary? 128 | // Original code logic: if (count($children) == 0) 129 | $children = get_categories( [ 130 | 'taxonomy' => 'category', 131 | 'parent' => $category->term_id, 132 | 'hide_empty' => false 133 | ] ); 134 | 135 | if ( empty( $children ) ) { 136 | update_post_meta( $post_id, $meta_prefix . $category->taxonomy, $category->term_id ); 137 | // Break after finding one bottom-level category to set as primary 138 | break; 139 | } 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/meta.php: -------------------------------------------------------------------------------- 1 | $args Optional. Additional arguments for register_post_meta or register_term_meta. Defaults to an empty array. 25 | * @return bool True if the meta key was successfully registered in the global array, false if not. 26 | */ 27 | function register_meta_helper( 28 | string $object_type, 29 | array $object_slugs, 30 | string $meta_key, 31 | array $args = [] 32 | ) : bool { 33 | 34 | // Object type must be either post or term. 35 | if ( ! in_array( $object_type, [ 'post', 'term' ], true ) ) { 36 | throw new \InvalidArgumentException( 37 | __( 38 | 'Object type must be one of "post", "term".', 39 | 'autoblogging-pro' 40 | ) 41 | ); 42 | } 43 | 44 | /** 45 | * Merge provided arguments with defaults and filter register_meta() args. 46 | * 47 | * @link https://developer.wordpress.org/reference/functions/register_meta/ 48 | * 49 | * @param array $args { 50 | * Array of args to be passed to register_meta(). 51 | * 52 | * @type string $object_subtype A subtype; e.g. if the object type is "post", the post type. If left empty, 53 | * the meta key will be registered on the entire object type. Default empty. 54 | * @type string $type The type of data associated with this meta key. Valid values are 55 | * 'string', 'boolean', 'integer', 'number', 'array', and 'object'. 56 | * @type string $description A description of the data attached to this meta key. 57 | * @type bool $single Whether the meta key has one value per object, or an array of values per object. 58 | * @type mixed $default The default value returned from get_metadata() if no value has been set yet. 59 | * When using a non-single meta key, the default value is for the first entry. In other words, 60 | * when calling get_metadata() with $single set to false, the default value given here will be wrapped in an array. 61 | * @type callable $sanitize_callback A function or method to call when sanitizing $meta_key data. 62 | * @type callable $auth_callback Optional. A function or method to call when performing edit_post_meta, 63 | * add_post_meta, and delete_post_meta capability checks. 64 | * @type bool|array $show_in_rest Whether data associated with this meta key can be considered public and should be 65 | * accessible via the REST API. A custom post type must also declare support 66 | * for custom fields for registered meta to be accessible via REST. When registering 67 | * complex meta values this argument may optionally be an array with 'schema' 68 | * or 'prepare_callback' keys instead of a boolean. 69 | * } 70 | * @param string $object_type The type of meta to register, which must be one of 'post' or 'term'. 71 | * @param array $object_slugs The post type or taxonomy slugs to register with. 72 | * @param string $meta_key The meta key to register. 73 | */ 74 | $args = apply_filters( 75 | 'autoblogging_pro_register_meta_helper_args', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound 76 | wp_parse_args( 77 | $args, 78 | [ 79 | 'show_in_rest' => true, 80 | 'single' => true, 81 | 'type' => 'string', 82 | ] 83 | ), 84 | $object_type, 85 | $object_slugs, 86 | $meta_key 87 | ); 88 | 89 | // Fork for object type. 90 | switch ( $object_type ) { 91 | case 'post': 92 | foreach ( $object_slugs as $object_slug ) { 93 | if ( ! register_post_meta( $object_slug, $meta_key, $args ) ) { 94 | return false; 95 | } 96 | } 97 | break; 98 | case 'term': 99 | foreach ( $object_slugs as $object_slug ) { 100 | if ( ! register_term_meta( $object_slug, $meta_key, $args ) ) { 101 | return false; 102 | } 103 | } 104 | break; 105 | default: 106 | return false; 107 | } 108 | 109 | return true; 110 | } 111 | 112 | /** 113 | * Reads the post meta definitions from config and registers them. 114 | */ 115 | function register_post_meta_from_defs(): void { 116 | // Ensure the config file exists. 117 | $filepath = dirname( __DIR__ ) . '/config/post-meta.json'; 118 | if ( ! file_exists( $filepath ) 119 | || 0 !== validate_file( $filepath ) 120 | ) { 121 | return; 122 | } 123 | 124 | // Try to read the file's contents. We can dismiss the "uncached" warning here because it is a local file. 125 | // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown 126 | $definitions = json_decode( (string) file_get_contents( $filepath ), true ); 127 | if ( empty( $definitions ) || ! is_array( $definitions ) ) { 128 | return; 129 | } 130 | 131 | // Loop through definitions and register each. 132 | foreach ( $definitions as $meta_key => $definition ) { 133 | // Extract post types. 134 | $post_types = $definition['post_types'] ?? []; 135 | // Unset since $definition is passed as register_meta args. 136 | unset( $definition['post_types'] ); 137 | 138 | // Relocate schema, if specified at the top level. 139 | if ( ! empty( $definition['schema'] ) ) { 140 | $definition['show_in_rest']['schema'] = $definition['schema']; 141 | // Unset since $definition is passed as register_meta args. 142 | unset( $definition['schema'] ); 143 | } 144 | 145 | // Register the meta. 146 | register_meta_helper( 147 | 'post', 148 | $post_types, 149 | $meta_key, 150 | $definition 151 | ); 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /src/Service/ArticleService.php: -------------------------------------------------------------------------------- 1 | process_article( $article_data, $status, $action ); 22 | } 23 | } 24 | 25 | /** 26 | * Process a single article 27 | * 28 | * @param array $article_data 29 | * @param string $status 30 | * @param string $action 31 | * @return void 32 | */ 33 | protected function process_article( $article_data, $status, $action ) { 34 | global $wpdb; 35 | 36 | $article = (object) $article_data; 37 | $meta_key = 'autoblogging_pro_article_id'; 38 | $meta_value = $article->id; 39 | 40 | // Check if post exists 41 | $exists = $wpdb->get_var( 42 | $wpdb->prepare( 43 | "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s", 44 | $meta_key, 45 | $meta_value 46 | ) 47 | ); 48 | 49 | if ( $exists > 0 ) { 50 | return; 51 | } 52 | 53 | $keywords = isset( $article->seo_keywords ) ? $article->seo_keywords : ''; 54 | 55 | // Handle array keywords (API v2+) 56 | if ( is_array( $keywords ) ) { 57 | $keywords = implode( ',', $keywords ); 58 | } 59 | 60 | $article->focus_keyphrase = isset( $article->focus_keyphrase ) ? $article->focus_keyphrase : explode( ',', $keywords )[0]; 61 | 62 | // Handle images in content 63 | $image_service = new ImageService(); 64 | if ( $article->image_count > 0 ) { 65 | $article->description = $image_service->process_content_images( $article->description, $article->id ); 66 | } 67 | 68 | $new_post = [ 69 | 'post_title' => wp_strip_all_tags( $article->title ), 70 | 'post_content' => $article->description, 71 | 'post_name' => sanitize_title( preg_replace( '/\b(a|an|the)\b/u', '', strtolower( $article->title ) ) ), 72 | 'post_status' => $status, 73 | 'post_author' => 1, // TODO: Make configurable? 74 | 'post_excerpt' => $article->seo_description, 75 | ]; 76 | 77 | if ( 'schedule' === $action ) { 78 | $new_post['post_date'] = $this->calculate_schedule_time(); 79 | } 80 | 81 | $post_id = wp_insert_post( $new_post ); 82 | 83 | if ( $post_id && ! is_wp_error( $post_id ) ) { 84 | add_post_meta( $post_id, 'autoblogging_pro_article_id', $article->id ); 85 | 86 | if ( ! empty( $article->tags ) ) { 87 | wp_set_post_tags( $post_id, $article->tags ); 88 | } 89 | 90 | $this->set_categories( $post_id, $article ); 91 | 92 | // SEO Plugins Integration 93 | $seo_integration = new SeoIntegrationService(); 94 | $seo_integration->update_meta( $post_id, $article ); 95 | 96 | // Featured Image 97 | if ( ! empty( $article->image ) ) { 98 | $image_service->sideload_image( $article->image, $post_id, 'featured', $article->focus_keyphrase ); 99 | } 100 | } 101 | } 102 | 103 | /** 104 | * Calculate schedule time 105 | * 106 | * @return string 107 | */ 108 | protected function calculate_schedule_time() { 109 | $current_datetime = new DateTime(); 110 | $current_date = $current_datetime->format( 'Y-m-d' ); 111 | $schedule_time = get_option( 'autoblogging_pro_publish_time', '00:00' ); 112 | return $current_date . ' ' . $schedule_time; 113 | } 114 | 115 | /** 116 | * Set categories for the post 117 | * 118 | * @param int $post_id 119 | * @param object $article 120 | */ 121 | protected function set_categories( $post_id, $article ) { 122 | if ( empty( $article->category ) ) { 123 | return; 124 | } 125 | 126 | $categories = explode( ',', $article->category ); 127 | $category_ids = []; 128 | $article->categories = []; // Ensure this property exists for SEO integration 129 | 130 | foreach ( $categories as $category_name ) { 131 | $category_name = trim( $category_name ); 132 | $term = term_exists( $category_name, 'category' ); 133 | 134 | if ( is_array( $term ) ) { 135 | $category_id = $term['term_id']; 136 | } else { 137 | $result = wp_insert_term( $category_name, 'category' ); 138 | if ( is_wp_error( $result ) ) { 139 | continue; 140 | } 141 | $category_id = $result['term_id']; 142 | } 143 | 144 | $category_ids[] = $category_id; 145 | $article->categories[] = get_term( $category_id, 'category' ); // Store full term object or at least an object with term_id 146 | } 147 | 148 | wp_set_post_categories( $post_id, $category_ids ); 149 | } 150 | 151 | /** 152 | * Fetch articles from API and sync 153 | * 154 | * @return void 155 | */ 156 | public function fetch_and_sync() { 157 | $api_url = 'https://www.autoblogging.pro/'; // Should ideally be injected or constant 158 | $app_url = $api_url . 'api/articles'; 159 | $domain = get_site_url(); 160 | $api_key = get_option( 'autoblogging_pro_api_key' ); 161 | 162 | if ( empty( $api_key ) ) { 163 | return; 164 | } 165 | 166 | $response = wp_remote_get( 167 | $app_url, 168 | [ 169 | 'headers' => [ 170 | 'Domain' => parse_url( $domain, PHP_URL_HOST ), 171 | 'Authorization' => 'Bearer ' . $api_key, 172 | ], 173 | 'timeout' => 45, 174 | ] 175 | ); 176 | 177 | if ( is_wp_error( $response ) ) { 178 | throw new \Exception( 'Connection error: ' . $response->get_error_message() ); 179 | } 180 | 181 | $body = wp_remote_retrieve_body( $response ); 182 | $code = wp_remote_retrieve_response_code( $response ); 183 | 184 | if ( $code !== 200 ) { 185 | $error_data = json_decode( $body, true ); 186 | $error_msg = isset( $error_data['error'] ) ? $error_data['error'] : 'API Error ' . $code; 187 | throw new \Exception( $error_msg ); 188 | } 189 | 190 | $articles = json_decode( $body, true ); 191 | 192 | if ( isset( $articles['error'] ) ) { 193 | throw new \Exception( $articles['error'] ); 194 | } 195 | 196 | if ( empty( $articles ) ) { 197 | // Not necessarily an error, but good to know 198 | return; 199 | } 200 | 201 | $this->import_articles( $articles ); 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /templates/settings.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 | 17 |
18 | 19 | 20 | 21 |
22 |
23 |
24 | 25 | 26 | 27 |
28 |

Connect Your Account

29 |

Link your AutoBlogging Pro account to start publishing automated content directly to your WordPress site.

30 | 31 | 32 | 33 | 34 | 35 | Connect Account 36 | 37 |
38 | 39 | 48 |
49 | 50 | 51 | 52 |
53 |
54 |
55 | 56 | 57 | 58 |
59 |
60 | Connected 61 | Your account is linked and syncing 62 |
63 |
64 |
65 | 71 | 77 |
78 |
79 | 80 | 81 |
82 | 83 | 84 |
85 |
86 |
87 | 88 | 89 | 90 | 91 |
92 |
93 |

Publishing Settings

94 |

Configure how articles are published to your site

95 |
96 |
97 | 98 |
99 |
100 | 101 |
102 | 121 | 122 | 141 | 142 | 161 |
162 |
163 | 164 |
165 |
166 | 172 | 177 |

Articles will be scheduled to publish at this time each day.

178 |
179 |
180 |
181 | 182 | 190 |
191 |
192 | 193 | 275 | 276 |
277 |
278 | 279 | 842 | --------------------------------------------------------------------------------